As has been said up thread rape of both male and female prisoners, not just at times of war and conflict, but in the criminal system has been going on since people started taking prisoners.
These allegations against the IDF have been made for decades and since Oct 7 newpapers and news tv based in countries other than the UK and US have reported on them.
What is different now in Israel, that thanks to those reporters who have continued to raise this abuse the Israel government decided to take action. And even allowing for other extreme actions by the extreme right wing in Israel, nobody expected individuals to turn up and try and stop the arrest of the IDF personnel who had been accused.
This then led to a more public discussion in Israel, but even allowing for strong feelings againt Palestinians, I dont think that this is about the state or the entire population backing this as "legal".
I think why it is making news is I dont think any other country (where no doubt this happens behind closed doors) has ever had members of the Government of a country try and say it should be legitimised.
But at the moment, because Netanyahu is dependent on the right wing to stay in power, they are becoming more bold and blatant in their statements. eg starvation being a legitimate act of war, stopping aid convoys, burning Palestinains homes in the West Bank, illegally seizing their lands and demanding that all Gazans should be forcibily evicted from Gaza.
What is so disturbing is that those justifying rape and other abuse, because of who is being targetted (ie they are perceived to be the enemy), could if accepted, then be used by Hamas to say that it is legitimate for them to treat those they categorise as the enemy in the same way.
But I dont think you can say it is "sanctioned" by the state.
But quite clearly shows that if you put your political survival, as Neanyahu has done, at the whim of extreme right wing Zionists, they know the power they have and are more than prepared to make public displays of this.
https://www.aa.com.tr/en/middle-east/israeli-journalist-urges-rape-to-become-state-policy-for-palestinian-prisoners/3299001
https://www.cbsnews.com/news/israel-hamas-war-idf-palestinian-prisoner-alleged-rape-sde-teinman-abuse-protest/