This is a very good thing that you are hurting actually. You may repent and ask people for forgiveness, and this may ease your pain. A lot of people either forget about it, force themselves not dwell on it, or just learn to live with it.
But, in my view, there is a bigger issue here. You have finally realized that such situations, when you (your conscience) are out of tune with your actions, arise frequently. This is really a spiritual experience. You've seen the both of you: the Soul and the Ego. Ego is not so bad and you don't have to be so paranoid with what it does. It is conditioned by various things and if you've never been taught to control it, then You (the Higher Self of you) is out of control, and you are out of control too. The problem is that we are never in control, we can only control our attention, i.e. how intently we are listening, and our choice we have a chance to make. We are just a leaf going where the river of life will take us to get new realizations.
Console yourself by thinking that it was a necessary learning experience. If you had been smarter or prepared by the family and/or the society, or your religious sect, you probably wouldn't have done what you did. The problem is that when you associate yourself with that little miserable self that is always conscious of being perishable then you fall into temptation of doing stupid things more easily. If, however, you train yourself to be constantly aware of the presence of something deeper inside of you and learn to act according to that Super Call which is barely audible, then all those embarrassing situations were worth it and the frustrating moments of feeling guilty were not in vain.
P.S. Apologize for your misdeeds in front of the people or in your heart, and forgive yourself.