Obama made the remarks at the beginning of a Cinco de Mayo celebration in the Rose Garden.
The president said: "I know that a lot of you would rather be watching tonight's game -- the San Antonio Spurs against 'Los Suns' from Phoenix."
The line drew applause from the crowd.
The Suns made headlines the day before with their decision to wear "Los Suns" jerseys on the Cinco de Mayo holiday. A new Arizona immigration law has drawn widespread criticism from Latino organizations and civil rights groups that say it could lead to racial profiling of Hispanics. Obama has called the law "misguided."
Fans turned out to Wednesday's game wearing "Los Suns" jerseys and T-shirts and a group of four entered the arena with sombreros.
There was a lone protester holding up a homemade sign outside the arena who was against the idea of the "Los Suns" jerseys Phoenix wore Wednesday night for Game 2 of its second-round series.
Otherwise, it was a typical game night around US Airways Center.
The protester, who identified herself only as Karen from Glendale, held a sign which read The Phoenix Suns support drug runners; armed coyotes; drop houses; extradition; forced labor; forced prostitution of illegals; murder of Arizona citizens on their own property; assault on law enforcement officers.
"I was disappointed that the ownership for the Suns organization decided to not support our state's efforts to do something about the problem we have on our borders," said the woman, who added she came to the arena only to protest.
"How they feel personally on their own time is one thing, but as an organization that has so much influence over public opinion -- it's like the outsiders that come in. Their views on the bill are distorted, too."
Pedro Flores of Phoenix came to the game wearing an Amare Stoudemire "Los Suns" jersey and said he's proud his team is taking a stand on the controversy.
"It's good and on Cinco de Mayo day," he said. "I think it's great."
Information from The Associated Press was used in this report.