Originally (around the X Century), the celibacy was a way that the priests didn't left the properties to their children and other relatives and also to avoid rampant nepotism.
Nowadays I think is unecessary since we have better-organized laws that the Middle Ages, but nonetheless I think it could be maintained as optional (Catholic priests aren't the only religious workers who take celibacy vows...)