The National Football League and Fox, the broadcaster of the game, maintain the right to approve ads, and some advertisers walked a tightrope to get ads with immigrants approved. Before the game started, Coca-Cola re-aired an ad from 2014 called “America the Beautiful,” which depicts Americans of different races and religions singing the song in a variety of languages. The building supply company 84 Lumber had to change an ad that showed a Spanish-speaking mother and daughter in front of a border wall.

In a memo to employees after the executive order, Airbnb’s chief executive, Brian Chesky, was more explicit about his opposition. “This is a policy I profoundly disagree with, and it is a direct obstacle to our mission at Airbnb,” Mr. Chesky wrote on Jan. 29. That weekend, the company began to provide free and subsidized temporary housing for people who had been affected by the immigration restrictions.

Two Airbnb officials who were not permitted to speak on the record said the company had not planned to advertise during the Super Bowl until executives heard there was still ad space left.

Mr. Chesky and the company’s two other founders, Joe Gebbia and Nathan Blecharczyk, worked with Jonathan Mildenhall, the company’s head of marketing, to put together the 30-second spot in three days, an effort that typically takes weeks or even months.