There are two places where the player may receive a Master Ball:
1: At the Poke Ball Factory, after defeating Team Flare Scientists Celosia and Bryony. The president will offer you a choice between a Master Ball and a Big Nugget. It doesn't matter your choice, you get both anyway.
2: Win the highest prize at the Loto-ID Center.
I believe that's all.
OOPS sorry, didn't see the first (and quite possibly better) answer.