In the Sinnoh-based games, the player can only use the Azure Flute once they have caught DialgaDBD or PalkiaPSP, entered the Hall of Fame, and obtained the National Pokédex. When the player reaches the Spear Pillar at the top of Mount Coronet and steps one tile north from the entrance, they will be prompted to use the flute, which will play a unique and eerie tune and reload the Spear Pillar map with a steep staircase that leads to the Hall of Origin.
Source.
Based on your description, you likely haven't caught the box legend (Dialga/Palkia), entered the Hall of Fame, obtained the National Dex, and/or aren't taking enough steps in Spear Pillar. If you've fulfilled all the requirements for the flute to work, then a prompt should ask you to use the flute the first step forward after you enter Spear Pillar. If you don't get the prompt, then you haven't fulfilled one of the requirements. If you've defeated the box legend, they will respawn after you defeat the Pokemon League and enter the Hall of Fame. If you haven't obtained the National Dex, you do that by seeing all the Pokemon in the base Sinnoh Dex, then talking to professor Rowan in Sandgem Town.
Hope this helped and good luck catching Arceus.