I beg to disagree with your second paragraph, but completely agree with the third one.
I put a lot of effort into studying Thai language. I can get by with my spoken Thai, I can read and write (type) at the same level. I taught at a local university and don't go to bars. It took me many years to realize that for many (not all, maybe not even majority) of Thais, the more you know Thai people, culture, language, the more of a problem you are for them. They like stupid, naive, fresh off the plane, farangs who can get scammed easily.
Even though they present a tiny percentage of the whole population, nasty people, full of hate for farangs (and probably all others) manage to spoil my day every 1-2 weeks. I was an immigrant in the USA and in 20 years there, it had never happened to me. Not that there are no nasty individuals there, but there is common decency and law that protects everyone. That all is non-existent in Thailand. Farangs rank lower than street dogs in Thai mind.
Why would people think more highly of dirty farangs, when their elected leaders say to publicly? They have been more than explicit in their desire to get rid of long term foreigners. It doesn't matter to them if you speak Thai, if you're sexpat or a priest. For them, you're ugly, dirty farang who doesn't bring enough money into Thailand per day.
This connects to the third paragraph, which I completely agree with. They are just doing what's in their best interest - maximizing dollars extracted from a farang per day they are tolerating him on Thai soil.
When you accept what you already know, it will be easier...