Sodomy is contrary to natural law because it is not right conformity with the form of humanity.
As rational animals, we have to use our reason as the mode by which to decipher what conforms to our essence, i.e., the essence of man, thereby living in accord with it.
Goodness is indistinguishable from being. Therefore, procreation cannot be separated from the sexual act because it contradicts our nature which is to generate life (which is being, and therefore, good). It is irrational, and thus contrary to reason, to participate in something while separating from it its final cause or purpose, because without considering it the act itself is unintelligible.
Consequently, sodomy is contrary to human nature.