It's a direct result of the rigid class system that exists in Thailand, something my native UK managed to largely eradicate around 100 years ago.
It's why so many in a uniform or position of 'power' make life as difficult as possible for those they deal with, as the uniform gives them the imagined freedom to do whatever they want and to kick back against their otherwise lowly position on the social ladder. The abused becomes the abuser. It's a way of fighting back against the system.
And because every Thai from a very young age is taught their place on the social rung, and everyone is looked down upon by someone, frustration and resentment builds and builds, and suddenly they 'do a Popeye' - That's all I can takes, I can't takes no more - and they reach for the can of spinach. Or, in Thailand, the nearest gun or machete. Thai society is like a volcano about to explode, and it doesn't take much to send some over the edge and commit violence, even kill, over the smallest thing.