You're partially right, another reason is that some of the married priests were married before they became priests. Our local priest is one such fellow.The author of this article get's itclose, but not bang on.
The married Preists are former Anglicanpreists. When the Anglican Church started allowing Female ordination and then SSM, there were some Parishes that decided to split from the Anglican Church and "rejoin" the Roman Catholic Church. These Parishes were allowed to retain their Preist, with the condition of that if the Preist became "unmarried" for any reason that he would then take the vow of celibacy and continue on without the ability to remarry.
The Eastern Orthodox Churches have always allowed Preists to be married. While they do recognise the Vatican and the Pope, they have their own way of doing things.