If Jesus opposed homosexual activity, why didn’t he say something against it in the Gospels?


John tells us that not everything Jesus did was recorded in the Gospels and informs us of the reason the Gospels were written: “Now Jesus did many other signs in the presence of the disciples which are not written in this book; but these are written that you may believe that Jesus is the Christ, the Son of God, and that believing you may have life in his name” (John 20:30-31).
At the end of his Gospel, John again reiterates in an exaggerated way that the Gospels do not contain everything Jesus did: “But there are also many other things which Jesus did; were every one of them to be written, I suppose that the world itself could not contain the books that would be written” (John 21:25).
This being the case, it could be that Jesus did teach about the immorality of homosexual activity consistent with Old Testament teaching as well as later New Testament teaching and Sacred Tradition, but the Gospel writers didn’t record it.