Foreigners working for a Thai firm must hold a valid non-immigrant (Type B) visa, but so-called ‘digital nomads’ – who are often self-employed – can sidestep that requirement.
So, the 'raid' was because officials thought the foreigners were working for the co-working space.
I was confused by your seemingly conflicting comments (the other was about the six month visa allowing remote work), so I Googled it:
http://asiancorrespondent.com/127125/thailand-immigration-of...
Foreigners working for a Thai firm must hold a valid non-immigrant (Type B) visa, but so-called ‘digital nomads’ – who are often self-employed – can sidestep that requirement.
So, the 'raid' was because officials thought the foreigners were working for the co-working space.