Although modern science has been able to come up with a couple of theories, they can not answer the question to why people bite their nails.
Some theories include that people bite their nails because of stress, another suggests that that the desire to bite nails is an analogue of masturbation.