Why isn't puts the contracted auxiliary first because English questions invert the auxiliary and subject, and n't attaches to that auxiliary, so the negation travels with it.
So The shop is not open becomes Why isn't the shop open? The whole isn't moves together.
Why is the shop not open? also works; it just sounds more formal or careful, since the negation sits after the subject instead of riding along with the inverted auxiliary.
One case, step by step
Watch one sentence move step by step. Start with the statement The shop is not open on Sunday. The subject the shop sits before the auxiliary is, the way statements normally run, and not follows the auxiliary.
Now turn it into a why question. The wh-word why goes first, and the auxiliary jumps in front of the subject. Because it is a negative question, not contracts onto the auxiliary as it moves, so the whole package isn't travels together: Why isn't the shop open on Sunday?
Compare the same steps without contraction. Why is the shop not open on Sunday? also works, but there the negation stays behind as a separate word while only is moves. In everyday speech, the contracted isn't before the subject is what you will usually hear.
One caveat: the uncontracted version sounds more formal or careful, so speakers may prefer it when they want that fuller, more deliberate feel. But the mechanism is identical; only whether the negation contracts onto the auxiliary changes.