Bishops were required to be single men starting with 1 Nicaea, because having to take care of the spiritual well-being of everyone in your province eats up a lot of time, and given how often bishops have to travel around, it wouldn't be fair for the family to have their father and husband always be away from home and never have time for his actual family.
Priests in the Roman Catholic Church were later required to be celibate, because since priests and bishops were among the only literate people in all of Western Europe for a very long time, they were thus appointed to government positions by kings. And so in order to avoid priests and bishops passing down their assets to children and mixing church and state at every level, the Roman Church decided to abolish the married priesthood.
It should be noted that Eastern/Oriental Catholics, Eastern Orthodox, Oriental Orthodox and the Assyrian Church of the East all retain married priests; these churches have always allowed married men to be ordained to the priesthood, though they all required that bishops be single.