I see no reason for the Catholic Church to demand that its priests be unmarried.
Peter wasn’t.
But Jesus was unmarried, we have no certainty that Peter's wife was alive by the time of the Gospel, and then there is the whole issue of becoming "a eunuch for the sake of the Kingdom" among others.
I don't have time to explain all of the reasonings, but here is a document written by Pope Paul VI that gives explanations - some theological, and if I recall correctly, some practical.
The reason was that they were not keeping their promise to remain continent even while married. So they were told not to marry at all.
Continence within marriage was the norm from the apostolic period onward, based on Jesus’ and Paul’s words.
The Orthodox relaxed the discipline around 700. The claim that Paphnutius stood up at the Council of Nicea to assert that married priests originally were permitted marital relations with their wives has been shown to have been invented around 700.
There’s no evidence that married priests ever were permitted to have sexual relations after ordination.
Which is not to say raising a family is not God's work, too, just that attempting to do both is a herculean task, for no man can serve two masters.