It isn't.
Paul does recommend the unmarried state at one point.
And Jesus says that there are some who give up sex for God ("become eunuchs for God" - Origen took this a bit too literally).
Paul says that married people are divided in their attentions, which is certainly true.
But the Bible does not say that priests need to be unmarried. Indeed, it say that they can only be married once, and to one woman. Priestly celibacy is a disciplinary rule of the Roman Catholic Church, put in place because the Church was convinced, by bad experience, that Paul comments about divided focus was correct. Christ and Paul set celibacy for the reign of God as an extremely high aspirational goal. The Church decided to make a rule for its clergy out of that aspirational goal.
It could, of course, change this rule. There is currently no strong argument to do so.
Just to be complete, there are priests in the Catholic Church's Eastern Rites who are indeed married. There are even a few converts in the Western Church (from Anglican or Lutheran) who were ordained as priests while retaining their wives.
So it's not a dogma. Just a well-established practice.
SD
***But the Bible does not say that priests need to be unmarried. Indeed, it say that they can only be married once, and to one woman. Priestly celibacy is a disciplinary rule of the Roman Catholic Church, put in place because the Church was convinced, by bad experience, that Paul comments about divided focus was correct.***
Right, the Bible does not say that priest must be celebate, but the church adds to God's word and makes it so. There are way to many talented, God fearing men that need a wife that are being wasted by not being able to do their work for God.