I'm sorry you're going through this, more. The same thing happened to a close friend of mine, so I have some idea how much it hurts. :( There was a long history to it in her case - it continued a pattern, really. I wonder whether that's true for you too...?
Her boys were much younger when she separated from their dad - something like 4, 6 and 10. He stayed very involved in their lives, and had them 50% of the time at first. This was obviously good in one respect; but he was/is a very controlling man, and he was very angry with my friend, so he was often difficult. He operated 'contact rules' (and 'rules' generally) in his favour. So for instance, if birthdays or parents evenings or other significant events happened on his days with the kids, my friend was not allowed any involvement; but if they happened on her days, he would just turn up. He banned the DCs from eating sweets without discussing it with my friend, and then harangued her when she did not enforce the ban.
Over the years, he caused a lot of scenes, some of them quite outrageous - for instance withdrawing one boy from his school and enrolling him in another, without talking to my friend first. She hates conflict, and had been bullied by him for years, so did not deal with it well and was quite 'brow beaten'. :( From my POV as an outsider and friend, ExH's behaviour was not just controlling but abusive. If it had been me, I would have told him where to go; but she was always afraid of 'making things worse' and was quite conciliatory.
As the boys hit adolescence one after the other, their DF's behaviour became even more difficult for my friend. Whenever they argued with their mum, as teens do, ExH would milk it and encourage them to complain to him. Each of them, one after the other, learned they could phone their dad and say "Mum won't let me X", and he would drive over, pick them up, and very often let them do X.
DS1 (who of course hit his teens several years before the others) was living with DF full-time by the time he was 14, which hurt my friend hugely.
When my friend met and married someone else ten years after leaving ExH, he called her a 'slag' and encouraged the boys to be angry about it. Both the younger boys were also encouraged to leave their mum and live with their dad full-time, and did for periods; DS3 lived with his dad for most of his teenage years. He refused to talk to his mum for over a year, and there was another 6-12 months where she saw him only once a week in a 'neutral place' like Pizza Hut. :(
Effectively, IMO, ExH continued to abuse my friend for over a decade after their relationship had ended, using the children as 'weapons'. :(
The boys, through most of this, thought their father was marvellous.
But then there was a turning point: each of them in turn got to a stage in their lives where they wanted to make their own choices and do their own things, and this did not make their father happy. They started to fight with him. They started to notice how controlling and unreasonable he was. One by one, they asked my friend if they could come back and live with her.
Now, about a decade later, the boys have all left home, moved away and have their own lives. When they come back to visit, they stay with my friend not their dad. They keep in touch with her regularly, but with their dad only rarely, because it still causes problems. (For instance recently ExH phoned up my friend to say they must 'ban' DS3 from going travelling... He's 23).
Sorry more, I didn't mean to waffle on so long. But maybe some of that rings true for you... I suppose my point is that I think children often pick up one parent's anger, and adopt it as their own, so to speak. I think it happens if there is separation/divorce, when DCs are encouraged to 'take sides'. I think it particularly happens if one parent is dominant and controlling - perhaps because the kids are just used to being 'controlled' by that parent and thinking what they're told to think; or perhaps because it feels 'safer' to join their side.
It's incredibly painful and unfair for the other parent, who really is quite powerless, because the 'choices' are to 'fight dirty' and be as nasty and manipulative as the controlling parent - which you won't do if you are a thoughtful person who doesn't want to mess with your DCs' heads - or to 'play fair' and refuse to fight, therefore 'lose' :(
It can go on a long time. In my friend's case, it took each of her boys 7-10 years to work out their own opinions about their parents. (Sorry, more). I reckon the only thing you can do, is to wait. There will come a time where they will work things out and form their own opinions. This will probably come when your DS stops living with his dad and wants to make his own choices.
Meanwhile, you just have to let him know you are always there for him, that you love him... And beyond that keep it light - just send cards, the occasional chatty letter, without making any attempt to 'explain' or engage emotionally.
Remember Maryz's old mantra for dealing with difficult teens? "Detach, detach, detach". Your DS isn't a teen any more, and isn't being 'difficult' in the usual sense (drugs, crime, violence, etc.) but he is 'rebelling' in a quieter way - possibly against you because that's the only rebellion he can manage (yet)... It's difficult for you - probably more difficult than having a 'normal rebel' - and detaching and protecting yourself emotionally will help you cope.
Also, look after yourself. Do nice things for yourself. You are hurt and bereaved - that is quite natural and understandable - and you will find that it really helps if you treat yourself kindly (even if no-one else will) and make sure your life has some good things in it to help compensate for all the bad.
I wish you well, more.