I agree that a comment consisting of nothing more than "thank you" isn't particularly helpful, but a "thank you" + some twist or application tip is interesting and valuable. Sadly, some SO-cops just see the words "thank you", ignore the rest of comment and then immediately recite the rules and/or delete the comment.
As for SO communicating the difference, I think they already do. Their problem is that people like me _deliberately_ ignore "the rules" and post whatever we think is appropriate-- the mods just can't keep up.
If that happens, then the mod is out of line. But what can SO do to prevent that behaviour? If you have ideas I'm sure the community on Meta would be more than happy to entertain suggestions, that's how the platform evolves and grows.
While expressing thanks is definitely an admirable human quality and should be lauded, it frankly does not provide value to the other people viewing the page. Part of the problem, I think, is because "comments" on Stack Overflow have a different meaning and context than 99% of the web. They don't exist for some sort of "social" experience, but as a means of coordinating improvement to the content.
Maybe SO could do better to communicate that difference. Educating new users is one of the biggest challenges in the face of the eternal September that SO receives.