The process is too difficult for many to navigate, a court heard.
The Department for Work and Pensions has said it will appeal the decision.
Work Capability Assessment tests, which measure a person's entitlement to Employment and Support Allowance (ESA) by determining whether they are fit for work, were introduced in 2008 and are carried out on behalf of the government.
The law requires the government to make reasonable adjustments to avoid discrimination. Vulnerable claimants
At Wednesday's hearing, the Upper Tribunal - which is equivalent to the High Court - was told people who have conditions that mean they lack insight can struggle to gather the right documents needed for a successful claim, such as doctors' reports.
The judgment was the result of a judicial review brought by two claimants with mental health problems, whose identities have been protected.