Wow and you put up with that! If this had happened with an NZ or QF agent then they would probably be dismissed or at the very least put on baggage handling for a long long time! What amazes me is that (in my experience), UA and AA ground employees are so so rude, and the passengers just put up with it!
Lucky, you need to complain and not let UA just take your complaint and just shred it. Follow it up and make sure they tell you what sanctions they're going to take against the agent for his absolutely foul customer service!