England won the third Test after Stokes helped his side complete a record run chase of 359 by securing a second-innings score of 135 not out, while Leach scored a single run without dismissal to give the pair a partnership of 76 on the last wicket.
But Pietersen, who represented England between 2004 and 2014, said that fans’ admiration of Leach’s performance at Headingley were overlooking the 28-year-old’s poor bowling contributions as Australia retained the urn with victory in the fourth Test last week.
“You’ve got people in the stands taking the mickey out of him, wearing masks and fake glasses,” the South African-born former batsman wrote in a blog for Betway.
“Commentators are talking about his Specsavers deal. England are losing an Ashes series and he’s only taken eight wickets at 30 in three Test matches.
“It doesn’t look like he’s troubled anyone. It just annoys me.”
Following the conclusion of the third Test, a video emerged of Leach re-enacting his single run with his England teammates on the pitch in Leeds.
“Now I’m not saying that you don’t do these things,” Pietersen said. “It can be good for team spirit to have a bit of fun, but from my side, I want to win.
“I don’t want to see the crowd about how funny he is. I want to see him winning matches for England with his bowling.
“When we beat Australia, Graeme Swann took big wickets for us. For Australia, Shane Warne and now Nathan Lyon take big wickets.
“We had Monty Panesar. But Monty, who everybody laughed at when he fielded the ball, knocked over the likes of [Sachin] Tendulkar and [Virender] Sehwag, [and] got big Australian wickets.
“When we beat India in India, he and Swann bowled beautifully. Yes, some people laughed, but he was still doing his job. Jack Leach isn’t doing his job.
“So what does he want to be remembered as? Does he want to be remembered as this funny guy who can hold a bat, or as a match-winner for England?”
The final Ashes Test of this year’s series starts at The Oval on Thursday, and Leach has been named in an unchanged England squad.