Why would a man be mean to his ex girlfriend that he broke up with?

My ex and I communicate because of our son. Lately we've had a friendly relationship when we talk on the phone,run into each other in public, and he had even began coming over to visit our son at my home. We always do little chatting not much.

Then today he asked if he could take my son somewhere that he had known for years I was against. I got angry that he even asked it and said no told him why and he told me to shut up and that he's tired of me always telling him what to do. he even yelled"I don't need to hear your voice anymore" when I was saying that he should take our son somewhere fun.

I don't get why he's saying that about me when we never have fights and I don't tell him what to do at all. he goes out all the time and even cancels on our son so he can do whatever he wants.

Why is he saying this about me when he will be really nice one minute then say such a mean thing about me?