I do this too. Sometimes I get sores in my mouth, so any salty or sour thing I put in my mouth hurts. I started to become more conscious of doing it, so I do it less now, but I can't stop it completely.
Before of that I used to bite my nails, but then I got braces and I couldn't close my mouth completely and that became impossible. After I got my braces off, I started biting the inside of my mouth. I used to bite it so badly that the pain of even brushing my teeth was terrible.