Most kids have some sort of repeated behavior that is usually for security, like thumb sucking, twirling hair, touching mother's earrings, etc.
The nail biting may be a mimicked behavior or the start of a habit. Ignore it & don't fight this battle. Just let the child know to wash hands to keep the germs away from his mouth. Encourage him to do something else with his hands like playing with a ball