School tells pupils to 'wear rainbow badge'