When we've worked at a place for a long time, we get very comfortable there, and it begins to feel like a family, and we begin to get illusions about how we should reasonably expect things to happen. However, how we feel, or perceive that it would be right or fair for us to be treated are not at all the way it works in an ordinary workplace. This is particularly true in an "at will" state, which yours is.
It is apparent that your employer had some sort of problem with your work behavior and/or performance or the way you related to co-workers. While this may have fallen into your definition of a very minor issue, harassment but not even sexual (since, as you say, it did not even lead to your termination) it was obviously behavior that was displeasing to your employer.
Make NO mistake here, HR is not the evil agent of your destruction, your management and supervisors tell HR what they want done with you and how they'd like you to be handled. There has apparently been some reason that they have reason to believe you are going to do a lot of talking ordinarily, and have told you to keep a sock in it pertaining to this incident, or you will end up fired.
If you are the loudmouth chief complainer of the workforce, they can legally fire you for that, and even if your work is valuable to them otherwise, you will certainly not be perceived as their favorite if you are sowing dissention and complaining about your supervisors or what has been done to you. It is unprofessional behavior, as many people have pointed out to you. Seek counseling, talk to your friends and family members away from work, but do not bring either your personal problems to work, or air your work related grievances to co-workers.
I once had a supervisor who forbade professional employees to speak to each other on the job about anything much that was not necessary and work related. It was silly and made us feel juvenile and resentful. Of course we all had each other's phone numbers and talked to each other away from work, probably much more because of this rule. But was he within his legal right to demand this of us? Yes.
And I must admit, it did improve the atmosphere of this particular workplace, because some of the people were professional quality gripers and whiners. There had previously been much "teasing" between the employees that some didn't think was too funny, and the situation was drifting toward sexual harassment, so the employer had every right to bring the hammer down about our casual conversations.