It is not discriminatory giving locals discount.
Easily fixed yes, but they don't want to have to check every single person's ID card, logistical nightmare. The poor ticket guy doesn't want to ask every Chinese looking Thai person for their ID card, as this would be perceived as being racist. So few farang have Thai ID cards, they just assume we are all foreigners. I get the Thai price when I need to show my Thai ID, but it doesn't happen often, maybe once every 10 years. Speaking Thai is usually enough.
There should be a Thai ID card for foreigners, and I don't mean the Pink thing, which is for migrant labourers. There should be a Thai exam and if you pass, you get the ID card, or if you pay tax.
I often hear guys married to Thais moan, yet they don't work and have made absolutely no effort to integrate into society, for example not being fluent in the language.