In any case, I take it then that if I engage in intercourse with my wife simply for pleasure I would be committing a moral sin or something.
The view here isn't that a couple must intend on procreating with every act of sexual intercourse, but that the possibility of procreation cannot be deliberately avoided.
So what of the infertile couple?
The issue here is one of intent. If the sexual act is open to being procreative
in principle (semen is going into a vagina) then the couple commits no sin because the infertility is incidental, not deliberate. Again, the issue isn't that all sex must have an explicit intention to be procreative, but that you can't
deliberately avoid the possibility of procreation. It's a fairly clear position.
What of the widow or the spinster? Does the Church say masturbation is immoral for these people as well?
Yes, the very act of masturbation is in and of itself intrinsically immoral under this system because it's
A) not directed towards a spouse and
B) cannot result in procreation and therefore is a misuse of the sexual function. If you're not married then you cannot engage in any sexual activity whatsoever because you cannot meet those requirements of which both must be present. It must be with a spouse, and it must
in principle lead to the possibility of procreation.
Natural law?? What natural law?
The natural law regarding the created purpose (final casualty) of all created things by God.
https://en.wikipedia.org/wiki/Four_causes