Thailand has become a bit notorious in recent years for being quite difficult for people to remain in long-term. I am exempt from this because I have a legitimate job that even though it is part-time, is a real job and comes with a work-permit and a type of visa called a Non-Immigrant B visa. Anyone else with a legitimate job can have one of these as well and while it is very complicated process, once it is done you don't really have anything to worry about provided you carry on working for the same company or school.
There are also retirement visas that are relatively straight-forward but you can only be eligible for them if you are over 50 and have a certain amount of money that is regularly coming into a bank account of have a savings account with 800,000 THB that is parked in it.
src
There are however a lot of other people that simply want to stay in Thailand for the long-term and a lot of those people are online workers or digital nomads. Many of them are simply teaching English online or doing something with a foreign company. While there is technically a visa that exists for digital nomads it exists only in theory and the requirements are so strict for it that basically no one is eligible for it. While I don't remember the exact qualifications for it it is something along the lines of making over $100,000 a year from a singular employer and working remotely for a company that is not based in Thailand.
I know a lot of digital nomads, I don't know anyone that makes $100k from a singular employer and anyone I do know that makes that much does so in crypto and they certainly aren't going to report this income to anyone, let alone a government like Thailand.
So for a lot of people the next step for having a long-term visa was the fames "Volunteer visa" that started out as something legitimate, but just like almost anything else in Thailand, it quickly turned into a scheme rather than a program. A lot of people were duped or at least convinced by agents that they could get a volunteer visa and then pay a fee to whatever the organization was that they were meant to be volunteering with to not even ever turn up to volunteer. This seems like a really shitty way to live your life but if there is one thing I have learned in my years in Thailand, that is that if someone has an opportunity to make some money via a loop-hole, they are going to do it.
To me it seemed extra shitty to get a visa to "volunteer" for some organization that is meant to be helping someone like very poor children in rural areas and then simply paying the headmaster of these impoverished schools to sign the paper that says you are turning up to help when you have actually never even been there.
One of the people I know that had a volunteer visa once asked his agent if there was any actual volunteer work available for him to do because he was bored. The agent's response was a mixture of that he didn't really know and was confused as to why the foreigner would actually want to do volunteer work.
Basically it was a scam and governments around the world take particular offense at being defrauded... well that is unless they are getting their cut of the profits. Apparently, the fake volunteer organizations were not paying off the Immigration officials enough money and they decided one day to raid all of the organizations and bust all of the agents and their clients - who were the foreigners paying for long-term volunteer visas without actually volunteering.
src
The government acted very swiftly in a coordinated strike all across the country at the same time, which even though I tend to dislike the government here, was quite impressive to me. I don't have any idea how many people they busted on these fake volunteer visas but it was a lot. The agents were punished as well. The punishment for the foreigners was very swift though and instead of just cancelling their visas, the people who had these visas were deported and given only 1 day to get their things in order and get out of the country. This can be a very difficult thing to accomplish depending on your nationality because many countries around the world require you to have a visa before you can go there and this definitely takes longer than 1 single day.
I guess you could say that I feel kind of bad for a lot of these people because many of them were just trying to live their lives in a country that seems to have a love/hate relationship with their visitors. Thailand wants people to spend money here and their country's GDP kind of depends on it very heavily. At the same time they seem to go out of their way to kick people out that are in fact contributing quite heavily financially to the areas that they live in. The only justification that I could possibly think of is that the government doesn't mind you living here for the long term, they just have a different idea about what "long term" means. They also are probably attempting to prevent foreigners from driving up the prices on rentals and I suppose that is something that they should do.
I suppose if I were going to be at all combative about how the government handled this is that the people who had these visas were offered them by agents. Many of the recipients actually DID want to volunteer but were not given the opportunity to do so. Even the innocents ended up getting punished in this "purge."
Like clockwork though, the agents are already offering longer term "education visas" where it is pretty well-known that you aren't actually going to be learning anything. I would imagine these schools have found the correct immigration officials to bribe and a new scheme has already been invented. I've seen this happen so many times in the 6 years that I have lived here that I am quite certain that there will always be some sort of long-term visa scheme, they just change the name of it every few years or so.