I get the Church's reasoning.  You aren't telling me anything I don't know.  What you aren't getting is that in David's time your finely parsed sense of sin was not in operation.  To give you some perspective, try reading Graham Greene's the "Heart of the Matter".  It might help you understand how Catholic concepts of sin can lead scrupulous Catholics to think they are unforgivable.  I won't spoil the book too much, but the main protagonist is a heterosexual.