Hi there DustinM!
First, let me say thank you for posting your questions.
I'll post my thoughts here, I'm sure that if I miss-represent the Church on any teaching, some of the more learned folk will correct me
Catholics go way back on this, so bear with me.
We look at how God created man and how God intended for us to use this amazing gift of sex. We also look at how God instituted Marriage. We believe that all sexual acts should be done in context of marriage.
Sex has two purposes: Procreative and Unitive in marriage.
Sex was intended between husband and wife and needs to fulfill both these criteria for it to be beautiful as intended by God.
Out of this the whole birth control case is argued as well, since you take away the procreative aspect of sex.
Masturbation is essentially deriving sexual pleasure without the unitive aspect of sex.
The Catechism states it quite well:
2352 By
masturbation is to be understood the deliberate stimulation of the genital organs in order to derive sexual pleasure. "Both the Magisterium of the Church, in the course of a constant tradition, and the moral sense of the faithful have been in no doubt and have firmly maintained that masturbation is an intrinsically and gravely disordered action." "
The deliberate use of the sexual faculty, for whatever reason, outside of marriage is essentially contrary to its purpose." For here sexual pleasure is sought outside of "the sexual relationship which is demanded by the moral order and in which the total meaning of mutual self-giving and human procreation in the context of true love is achieved."
That, in essence is why Masturbation is a mortal sin.
I have not delved into the whole "Sin of Onan" thing, it it seems to be very much a controversial topic. In thinking of sex the way it was intended, one starts to see where the logic comes from.
Also, the Catechism teaches about lust:
2351 Lust is disordered desire for or inordinate enjoyment of sexual pleasure. Sexual pleasure is morally disordered when sought for itself, isolated from its procreative and unitive purposes.
Lust goes beyond just disordered desire, it also reaches to objectification. One could be guilty of lust even if you think of your wife that way. Catholics believe that if you have a "lustful" thought, or in your interpretation, even a thought of desire with a woman, and you willingly entertain that thought, that is a mortal sin.
We should strive to remain pure in all things, thought and deed.
Basically, Catholics look at the big picture of sex, how it was intended by God and we apply that to life.
Now, having said all of this, it is by no means easy...far from it, but god's forgiveness is infinite and the door ton the confessional is always open!
I hope this helped you to see the big picture?
Let me know if you have any more questions.
In Christ.