A 15-year-old boy was given detention after voicing his support for Ukip during a classroom debate, his father has claimed.