How are you supposed to obtain the Poke flute in Pokemon X and Y?
If you haven't already, go explore the castle in Camphrier Town and talk to the owner. Before the bridge with the Snorlax, there's a fork in the road. Take the upper path to Route 6, and follow it to Parfum Palace, where you and Shauna will be tasked with finding the owner's Furfrou, in the garden in the back.
Specifically, the Furfrou is in the top-left section of the garden, where you will have to solve a puzzle to corner the Furfrou, after which the owner will show his appreciation with a fireworks show and allow you to borrow the flute. Return to the Snorlax and the flute will be played and you'll have to catch or faint the awoken Snorlax. The Flute is then returned to its owner, and you continue on your journey.