As Mayflower correctly notes, this isn’t really a Catholic thing. It’s a New Testament thing.
It is not a complete reading of the words of Christ.
In Mathew, Jesus also said ...
Jesus replied, It was because of your hardness of heart that Moses permitted you to divorce your wives; but it was not this way from the beginning. Now I tell you that whoever divorces his wife, except for sexual immorality, and marries another woman, commits adultery.
Matthew 5:32
Jesus:
but I say to you that everyone who divorces his wife, except for the reason of unchastity, makes her commit adultery; and whoever marries a divorced woman commits adultery.