If a married person were to undergo a procedure, take a medication, or use a device for the real and primary purpose of evading the natural likelihood that procreation will accompany the marital act, that is wrong, whether the effect is temporarily or permanent. (It is not wrong for a non-complicit spouse to engage in marital relations with a contracepting spouse.) It is permissible to engage in marital relations after repenting of this, but a person would be guilty of the sin of presumption if he or she were to be sterilized with the “plan of repentance”.
If a married person chooses or accepts a procedure, medication, or device as treatment other symptoms that interrupts or ends the person’s fertility as a side effect, that is permissible, provided that the symptom being treated is not trivial and an equally suitable treatment without that side effect is not readily available.