The ruling from U.S. District Judge James Donato in San Francisco rejected Airbnb’s contention that the ordinance violated a broad federal law that protects internet companies from liability for content posted on their platforms.