The OP said he has already visited Thailand for several months this year and that he had no visa for that.
This kind of behaviour is not normal for tourists, the visa system is designed for people like this. Further, he probably told the IO he has family here, again a negative factor in whether or not he is a genuine tourist.
Admission is at the IO's discretion, if you have a history of what appear to be border bounces, the IO may well ruin your trip. The IO does not have to follow the rules and regulations, he has absolute discretion, yes you can appeal, but people rarely know that.