Uh parties often are right after the ceremony.
So we definitely need more details. If he wasn’t in uniform and it wasn’t an open invite to his unit then this punishment doesn’t sound legit. But if he was he took the risk upon himself.
I had 3 promotions ceremonies. One to 1LT, one to Captain and one to Major. None of my promotion parties took place "right after" the ceremony. None of the other promotion parties I attended were "right after" the ceremony.
Ceremonies are normally first thing in the morning of the day the promotion is effective. Parties are after close of business after the end of the duty day.
Two other things need to be said here: One is that the newly promoted soldier is 100% responsible for all costs associated for the party; and two they are open to all who want to come celebrate the promotion. Where did you get the outlandish idea that you couldn't appear in uniform or that it couldn't be open to anyone wanting to come?