This is a telling symptom of a problem. If your normally well-behaved cat starts to do this, he/she is trying to get your attention and trying to tell you something. Take him/her to the vet.
If a person is inexperienced with animals, more often than not they think this problem is simply the animal "being bad".