The education secretary says schools must not tackle political issues in a "partisan" way after pupils were asked to write a letter that criticised the prime minister during a lesson.
Pupils from Welbeck Primary School, in Nottingham, said Boris Johnson was a hypocrite and called for him to resign.
Its head teacher said children were "encouraged to express their thoughts".
But Nadhim Zahawi said schools should not encourage pupils "to pin their colours to a political mast".
Head teacher Rebecca Gittins said Year 6 pupils watched a BBC Newsround episode about Downing Street and were asked to write to their MP to share their views, in a lesson linked to the English curriculum.
Referring to the report, which stated that Mr Johnson was under investigation for 12 parties, the letter says: "This will now influence people to not listen to any new regulations and instead copy the footsteps of Boris Johnson.
"He is a hypocrite and can no longer be trusted as our leader and should resign as the country is not in the right hands."
In images of the letter shared on social media, one pupil wrote: "This week in Year 6 we have been looking at our aspirations and role models for the future."
"We have looked at famous leaders such as Nelson Mandela and Barack Obama and we have also looked at teachers and head teachers who are doing their part in keeping us happy, healthy and safe," it adds.
"We also looked at people who we respect and disappointingly, our own Prime Minister has not made it on to this list," the letter says.
Head teacher Rebecca Gittins said: "There is no 'teaching' of politics. We explain processes and structure, with the children encouraged to express their thoughts."
She added displaying the work on Twitter received five abusive responses, "which was really disappointing" and a decision was taken to remove the tweet.
Mr Zahawi said: "While there is a clear need for schools to address political issues in the classroom from time to time, this must not be done in a partisan way.
"No school should be encouraging young people to pin their colours to a political mast."
The news comes after the education secretary's intervention over the teaching of "concerning" theories around racism by Brighton and Hove Council.
Slides from race training given to teachers in Brighton and Hove schools, leaked to the Sunday Telegraph, said that "between the ages of three and five, children learn to attach value to skin colour: white at the top of the hierarchy and black at the bottom".
Mr Zahawi said his officials were in contact with the council to investigate the materials.
David Mellen, Labour leader of Nottingham City Council, said they were "supportive" of Welbeck Primary School's work and "would never discourage young people from engaging with local representatives and politicians".
But Brendan Clarke-Smith, Conservative MP for Bassetlaw in Nottinghamshire, said the original tweet contained "overtly political messages".
He added: "I think it is really important with children we encourage them, we stretch them, we debate and that's really healthy.
"I did that as a teacher and I'm a former head myself, I get that, but I think a few lines have really been crossed and I think it's gone into projecting someone's personal political message."