When the bad guy (I don't remember his name) shoots at Gustave and Zero, the soldiers having rooms on Gustave's side come out and shoot at the bad guy which is understandable. Then for some reason the soldiers having rooms on the bad guy's side come out and there is an shootout between the soldiers on both sides. Now why would the soldiers on the bad guy's side come out and shoot at their own soldiers?
Because no one bothered to ask. Everyone is shooting and no one care to stop. They just pop up and are happy to get involved. It's not until the Inspektor Henckels ask "who's shooting who" and only Gustave and Dimitri know the answer (of which only Dimitri was the "active" part of a shootout).
In movie langiage this is a satire on war where no reason is present, the violence is sensless and people shoot at each other just because they are on the oppossing sides.