Online hospitality service Airbnb scored a major win in the European Court of Justice after the advocate general, Maciej Szpunar, ruled that the company should be treated as a digital service provider and free to operate across the European Union.

The ruling struck down a lawsuit by France's tourism association which tried to restrict Airbnb's services after a Paris prosecutor acted against the company in 2017 following a hotel association’s complaint.

According to the court, Airbnb can no...