Former deputy leader of Labour claims she was marginalised for being female and gives 'examples of sexism' in parliament

The deputy Labour leader, Harriet Harman, has spoken of how she felt sidelined as a woman in Gordon Brown's government as she was passed over for the role of deputy prime minister and told her involvement in a G20 summit was to be limited to dinner with leaders' wives.

In a speech at Westminster on Tuesday night about equality in politics, Harman revealed her experiences of sexism at the very top of government, saying that politics has a long way to go before it is representative of society, in terms of women, race and class background. Those in positions of power too often profess a belief in equality without being prepared to bring about change, she said.

Harman, deputy to both Brown and Ed Miliband, said: "The truth is that even getting to the top of the political structures is no guarantee of equality. Imagine my surprise when having won a hard-fought election to succeed John Prescott as deputy leader of the Labour party, I discovered that I was not to succeed him as deputy prime minister. If one of the men had won the deputy leadership would that have happened? Would they have put up with it? I doubt it."Harman said that if something similar had happened in any other job it would have gone to an employment tribunal.

She continued: "Imagine the consternation in my office when we discovered that my involvement in the London G20 summit was inclusion at the No 10 dinner for the G20 leader's wives. We must remember Caroline Flint's denunciation of women being used as 'window dressing'."

Harman also recounted getting advice from male colleagues not to "bang on too much" about women's issues, to keep her head down and hang out in the bar to show she was "clubbable".

"I couldn't hang out drinking in the bar when I was feeling sick from pregnancy or rushing back home to put the babies to bed. Because I didn't conform, the punishment for being different was often nasty.

"When I came back after having my first baby I was reported to the serjeant-at-arms for breaking the rules by taking my baby through the division lobby under my jacket. Of course I'd done no such thing – I was still fat from being pregnant. What made it worse was that it was obviously my own side. I told the whips I'd have to miss a vote because I was ill – with mastitis. And they put it in the papers."

Harman, a lifelong campaigner for gender equality, who was instrumental in getting more female Labour MPs into parliament, said her party was "acutely aware" it could still be more representative of society and she would like to see more working-class women elected in particular. She said there was no longer "active opposition" to women in parliament, but there was too much "passive resistance" and not enough effort to promote equality.

"You don't have to openly oppose equality to perpetuate inequality … All it takes is for those in positions of power to do nothing and the status quo prevails. Progress towards equality requires men to change as well as women. Particularly men in positions of power."

Another problem is the way a female MP is "still defined by her marital status and reproductive record in a way that would be unthinkable for a man".

She said: "In any interview, a young woman MP who doesn't have children is challenged to explain herself. Something that doesn't happen to a married man MP … An MP father who attends his child's school open evening can tell everyone about it in a loud voice and is admired as heroic. But a woman MP best not mention it because she'll soon be identified as insufficiently committed to her work.

"And this is because the underlying reality is, and the cultural expectation is, that it remains the case that in most families, it's the mother who takes the daily responsibility for young children – and indeed for older relatives."

Harman criticised David Cameron, who presides over a cabinet with just three female members for surrounding himself with his few senior women during PMQs. "Women must not only seen but also be heard. It's really a deliberate misrepresentation to have the few Tory women MPs clustered around the prime minister, so that they can be picked up by the TV cameras while the rest of the government benches are nearly exclusively men."

The senior Labour MP said it is also vital that the power structures behind politicians are also representative, including special advisers and political journalists. "It is not only on the green benches that power is exercised but also in the corridors.

Harman added: "Remember in [the sitcom] The Thick of It the special adviser was more powerful than the junior ministers. The overwhelming majority of special advisers are still white men.

"And they work with a press lobby which is the same with a mutually reinforcing homogeneity … the lens through which an overwhelmingly male parliament is reported on to the public and commentated on is, itself, woefully male."

Asked if she expects to become deputy prime minister if Labour win in 2015, she said she hoped she would. But she would not be drawn on whether she would call Miliband sexist if she was not.

Her comments about the G20 summit were rejected by Damian McBride, a former spin doctor to Brown, who was involved at the time. He tweeted: "It's utter bilge from Harriet, done to make her attack on Dave look non-partisan. And shameful timing given the work GB is doing in Nigeria.

"That dinner was a gathering of Britain's leading women across all walks of life, of which I thought she'd count herself one."

In a blog, he said that Brown's key economic adviser at the G20 summit was Lady Vadera.