Developers, Newco 8915 Limited, wanted to demolish an office block, Threshold and Union House, at Shepherd's Bush Green, to make way for the hotel.
But, according to the High Court judgement, residents in nearby Pennard Road, led by Sabine Guerry, argued that the planned hotel would lead to loss of light, outlook and privacy for their homes, in the Shepherd's Bush Conservation Area.
The London Borough of Hammersmith and Fulham followed the advice of one of its planning officers and, despite the objections, granted planning consent in February.
According to the judgement, the officer said a reduction in light levels caused by construction projects was "not uncommon" in heavily built-up areas.
Only some of the homes in Pennard Road would be affected, and guidelines on loss of daylight had to be "applied flexibly and sensibly."
Upholding Guerry's challenge, however, Judge Justine Thornton said the officer's report to councillors was "flawed."
He had misapplied Building Research Establishment (BRE) methodology used to assess the impact of loss of light, the judge said.
Councillors were not told that "both the total amount of daylight and the distribution of light within a building are important", she added.
Although it was not the officer's fault, the judge ruled that "councillors were significantly misled" by his report.
"Councillors were not therefore in a position to form a judgment on the impacts of daylight distribution at properties on Pennard Road, or aware that they needed to do so."
The judge concluded: "The decision to grant planning permission was unlawful and the planning permission granted by the council will be quashed."
In April, a judge quashed a planning approval for a 62-home development in east London after concluding that an officers' report considered by the council's planning committee was "materially misleading" regarding the scheme's impact on sunlight and daylight.
A Planning briefing on rights to light issues can be found here.