That wasn't ego on the part of the instructor - you miss the point through not understanding etiquette on the mat. It's not etiquette just to be cutesy; etiquette ritualizes discipline which IS necessary for safety - yours and others.
The response he was probably seeking was, "Yes, sir." With all due respect, you can't have the option of railing against ego and then choosing yourself to be a temper-tantrum-throwing ego-ist
I live near the Mississippi River. It's a very powerful body of water, with an extremely strong current. Within its banks it has the power to help move commerce from my area to yours. The banks (form) give it shape (discipline.) Without form it's called a flood (undisciplined), which is what your behavior was.
Be thankful the sensei was more disciplined than you - if he wasn't you would have reached your satori on your back looking up seeing stars. (Any self-respecting dojo would expel you for repetitions of that.)
Rebellion against everything for the sake of rebellion has no meaning - it's just self-gratification.