You shouldn't enter the classroom with your hat on.

Literal

Hat [object-を] wore-[state-maintained-たまま] [instrumental-で] classroom [into-に] enter-[should-not-べきではない]

Three instructive pieces. ~たまま attaches to the past form of a verb and means 'remaining in the state achieved by X' — here, 'still having put the hat on.' ~べきではない is the negative of the moral-obligation ~べきだ: 'shouldn't', in the sense of 'it's wrong to'. The で after まま is an adverbial marker: 'in that state'.