First, know that there are two types of priests, secular and regular. Secular priests are the ones you have at your local parish, that say Mass and do the day-to-day functions of your church. They deal with the secular world, in other words. Regular priests are monks; in other words, those with extra REGULATIONS. The “regular” part refers to that, not them being like average people. Until around 1100, up until the Cluny Reform Movement (which was a highly successful “internal” reformation of the Catholic Church that corrected many problems and led to a great reduction of corruption between 900-1300), a person could become a secular priest if they were already married. That said, once you became a priest, if you were not already married, you could not go out and get married, and if your wife died, you couldn’t get remarried. Regular priests, however, have always practiced celibacy. That was one of the original “extra” regulations, so to speak.
Well, there were several problems with this system. First, being a priest was a difficult job that required a lot of travel. Due to the numerous small manors and kingdoms that abounded through Europe, a priest would have to travel a circuit, saying Mass in as many as twenty different cities in a month. He might only actually be home a few days a month. This was not a conducive environment to being a good father or husband, and it also provided plenty of opportunity for infidelity. Second, there were great problems with nepotism. Priests would use their position in society to get cushy jobs for their kids. This could be either in the church (as a priest, etc.), or with a secular lord (as a knight, guild master, etc.). Sometimes, they would even use money from the collection plate as bribes to accomplish this. The families of many priests also lived a very high lifestyle, with many of them rivaling the wealth of the lords whose manors they lived on or near. One problem that is often referred to by some but usually overstated is inheritance. It is often believed that the Church ended celibacy because they wanted to hold onto property that children might inherit, but this wasn’t often an issue, because the land and buildings were often simply owned and provided by the local lord. The priest didn’t actually own them anyway. So, when a large monastic order in the French city of Cluny proposed extending celibacy to the entire church (along with other reforms), it was seen as a very popular change, and ended certain problems the church experienced almost immediately. It is ironic that many now call for an end to celibacy, since it was instituted as a popular reform to begin with. It just shows that there will always be problems to deal with, you just need to pick your poison.
It should also be noted that this ruling only applied to the Western Catholic Church. Eastern Catholic Churches (along with the Orthodox) do not mandate celibacy, and will still allow married people to become priests. Even in the West, exceptions can be occasionally made for pastors that convert from other faiths, especially Anglicans and Lutherans. Many people are unaware that there are actually close to 100 married CATHOLIC priests in the United States.