The texts can be immoral.
Our understandings can be immoral. . not the texts.
The texts cannot be forbidden.
For example. . .
And they followed what the devils recited regarding the kingship of Solomon.
Solomon did not reject, but it was the devils who rejected by teaching people magic,
and teaching them what was sent down on the two angels in Babylon, Haroot and Maroot.
They did not teach anyone until they would say:
"We are a test, so do not lose faith!"
Thus they teach what can separate between a person and his mate;
but they cannot harm anyone except with the permission of God.
And they learn what harms them and does not benefit them,
and they have known that he who purchases such has no place in the Hereafter.
Miserable indeed is what they purchased with their souls if only they knew!
(2.102)
Is it the text that is forbidden, or practising what the text is saying is forbidden ?
I believe it is practising what the text is saying which is forbidden. . .
Another example, flesh of swine. . . flesh of swine is not forbidden
but it is the act of eating flesh of swine that is forbidden.
Another example, money is not haram. . but the act of taking usury is haram. . .
so , it is the act of taking usury that is forbidden, not the money etc.