According to the website of the Thai Embassy in Stockholm (emphasis mine):
For Swedish passport holder, and wish to stay in Thailand for no more than 30 days, your passport has to be valid for at least 6 months when you enter Thailand. (according to immigration law). The immigration officer can make an exemption for you if your passport is only valid during your stay in Thailand. We do strongly recommend that your passport has a validity of at least 6 months. You shall also check with your airline for other requirement.
Similar information is stated on the website of the Thai Embassy in Tel Aviv (emphasis mine):
Can I enter Thailand without a visa?
Nationals of Israel are eligible to travel to Thailand, for tourism purpose, with the exemption of visa and are permitted to stay in Thailand for a period of not exceeding 30 days.
However, please make sure that you are in possession of a passport valid for at least 6 months, a round-trip air ticket, and adequate finances equivalent to at least US$1,000 per person or US$2,000 Baht per family. Otherwise you may be inconvenienced upon entry into the country.
Similar information is echoed by other countries informing their citizens. The UK's Foreign Office website states (emphasis mine):
Your passport must have at least 6 months’ validity remaining from your date of entry into Thailand. Entry to Thailand is normally refused if you have a passport which is damaged or has pages missing.
The US State Department has similar information, but only uses recommend rather than phrasing it as a strict requirement:
PASSPORT VALIDITY: 6 months from date of entry recommended
I've searched through and English version of the Immigration Act, B.E. 2522, but I haven't found it. I may have overlooked it, but it may also be one of those unwritten rules.
So my question is whether this requirement is (still) enforced. Are there any stories of people being refused entry solely for not having a passport with 6 months validity remaining?