am I right for doing this?

So my ex and I broke up six months ago because his mom ractist and doesn't like black people which I am! So we decided to stay friends but I thought we'd get back together once he moved out and noting changed but he dating and I realized I can't be friends because I still like him so I told him I can't be friends with him for those reasons and he thought I was unreasonable was I wrong for cutting off the friendship because I thought it help me move on?