A former WeWork manager has filed a "charge of discrimination" against the firm and its co-founder Adam Neumann.
Medina Bardhi, his former chief of staff, argues she feared for the health of her unborn baby during her first pregnancy because he smoked marijuana on chartered planes
She says he characterised her maternity leave as "retirement" and "vacation".
WeWork, which has faced upheaval in recent months, said in a statement it would "vigorously defend itself".
Mr Neumann agreed to step down as chief executive in September saying it was in the firm's "best interests" as the office space company raced to find fresh financing.
Ms Bardhi's complaint was made to the US Equal Employment Opportunity Commission on behalf of herself and "a class of similarly situated female WeWork employees".
She said was told to leave on 2 October - a week after Mr Neumann stepped aside - which was only months after giving birth for the second time and "just weeks" after raising discrimination concerns with management.
Ms Bardhi, who joined WeWork in 2014, said she had lost her position and responsibilities to a male colleague during her second maternity leave.
She said the discrimination was not new, and she had felt it during her first pregnancy in 2016.
Ms Bardhi had decided to disclose the fact she was pregnant early because she could no longer accompany him on business travel.
She had been worried for her unborn child "due to his penchant for bringing marijuana on chartered flights and smoking it throughout the flight while in the enclosed cabin".
When she returned from maternity leave the first time, she was not given her old job back for several months, she said.
The company has rejected the claim. In a statement sent to the BBC, it said: "WeWork intends to vigorously defend itself against this claim. We have zero tolerance for discrimination of any kind."
In the complaint, Ms Bardhi said it was not just about her as other workers had felt discrimination.
"For years, they have been subjected to a work environment in which female employees are demeaned for taking maternity leave, excessive alcohol consumption fuels offensive sexual conduct towards women, and where it is common for women to be paid less than their male colleagues," Ms Bardhi said in the complaint.
The allegations comes at a time when WeWork has already been facing tough times.
The company recently accepted a multi-billion-dollar rescue deal from Softbank after the collapse of its flotation plans and the ousting of Mr Neumann.
Mr Neumann received a deal of up to $1.7bn (£1.3bn) to walk away from the company he founded, made up of fees, his shares and help with loans.
WeWork leaders have recently also warned of major job cuts ahead.