This is a slighted edited version of my comment to someone asking about countries that have laws specifically detailing digital nomads are allowed to work on tourist visas. My background is in economics and investing based on economic understanding.
The question of digital nomads working encompasses legal questions (do I need a special visa etc.), regulatory realities (regardless of what the law says how is it enforced at the ground level?) and economics (I am talking here about the benefits to the country economically from having digital nomads).
I like the economic thinking that should drive what the government’s wish to accomplish. The prohibition against work on tourist visas makes sense when work is defined as it was historically (being hired by a company in the country that otherwise would have hired a citizen). So when I am thinking about it I find thinking about the macroeconomic level view and how that is manifest in laws and policy. From a practical standpoint of being a digital nomad what really matters is how that all gets filtered down to the government employees on the ground making decisions.
Few laws say what is legal, they normally say what is not. I would imagine few countries specifically say it is legal to do work from another country (as a digital nomad, as a employee answering an business email on their vacation, as a private investor reading the news and using the internet to buy or sell a stock, as a writer writing a book that will be published back home, an entrepreneur refining ideas to launch a new business back home or whatever).
The laws usually are pretty clear you can’t apply for jobs and get hired by a company inside that country to do work in that country on a tourist visa.
“Thailand” has said it is ok to work as a digital nomad (work for some company outside the country) while on a tourist visa. But these pronouncements by officials don’t carry much weight with other officials so they are not worth much.
What is helpful is knowing the prohibitions against working are primarily about not having foreigners take jobs of the citizens. Digital nomads don’t do that. So they are not meant to be prohibited anymore than the other examples (an executive participating in a conference call from work while on vacation etc.).
But since it isn’t clear cut it can be confused by officials as something not allowed. It is much easier not to have to get low level officials to comprehend the intent of the laws. They think of it as tourists can’t work in the country and that is essentially true. But how “work” is defined is the issue; and digital nomad work doesn’t fit the description of work in that context.