I think immigration officer saw on your passport that you had a marriage visa, so he knows you're married to a Thai and he thinks you can get a proper visa. You're still married so this is the problem why coming too many times with a free visa exemption makes the issue with the immigration. But if for example you were already divorced I don't think you would have an issue to come back to Thailand without a visa or with a tourist visa for example. I mean, why they shouldn't let someone in if he is single or divorced?