Representatives have been banned from wearing hats on the House Floor since 1837. Only religious headcovers (hijabs, yarmulkes, turbans) are allowed — and red cult hats don't count.
Also, ‘campaign gear’ — any item promoting a political candidate — is not allowed, per House rules.
Censure MTG for this stunt: