Bad experience with my PhD supervisor
Yes, you should thank him. You don't need to work with him in future, but, as you say, he helped you along. He helped you start your career and you can now be independent. If you did good work under his guidance it is worth a thank you, and you may be well positioned for good works in the future.
There are a lot of racists around, of course, and many of them don't understand what it really means. But your bad experience is now behind you and you were pretty lucky (and strong) to overcome the issues.
But you may need a letter from him in the future to continue your quest. Don't burn bridges that don't need to be burnt.

And the jokes of academics are often not as funny as they think and the worldview they have may not be shared as widely as they imagine.
There are, I suspect, hundreds of questions here from people who are in a bad relationship with their advisor but are not finished and so have serious decisions to make about continuing or leaving. You are lucky now to have that behind you.
Good luck.