You already recognized that this is an issue and you need to stop, therefore there's really no other answer that will make more sense than continual discipline of your habits.
Old habits are hard to kill but not impossible. Keep track of what you say and when you get those "urges", you as a person will need to have to strong will to stop it. You will fail but get back up again, continually get better and don't be discouraged.
There's usually a trigger in these cases as to why you start doing it, perhaps its boredom or the sense of enjoyment when you gossip, possibly you like looking down on others to make yourself feel better or you just don't value privacy. I don't know. But you will need to understand who you are and why you seem to take these actions.
Good luck OP.
NOTE: You should really post this to InterpersonalIntrapersonal Skills Exchange as this is more aligned with that site.