The 38-year-old actress sang the convicted paedophile's 1973 hit Do You Wanna Touch Me, whilst playing supply teacher Holly Holiday who was called into the high school to give a sex education class.
According to The Guardian, the single has since reached the US iTunes top 30 meaning that Glitter will receive royalties.
Director of children's charity Kidscape, Claude Knights, told the newspaper, 'It is regrettable that the producers did not consider the implication of using such a track in the context of a sex education class.
'The fact that this song is linked to Gary Glitter and the words themselves make it wholly inappropriate.'