According to Greg Sargent over at TPM:
A Pentagon spokesperson confirms to me that because of longstanding Department of Defense regulations, Pentagon officials told Obama aides that he couldn't visit the base with campaign staff. This left Obama with little choice but to cancel the trip, since the plan to visit with campaign aides had been in the works for weeks. [...]And Jonathan Martin reports (by way of Patrick Appel) that McCain sort of stuck his foot in it with an image used in the ad:
"We have longstanding Department of Defense policy in regards to political campaigns and elections," Pentagon spokesperson Elizabeth Hibner told me. "We informed the Obama staff that he was more than welcome to visit as Senator Obama, with Senate staff. However, he could not conduct the visit with campaign staff."
After being told this, the Obama campaign announced yesterday that it had decided it was "inappropriate" to make the visit as part of a campaign trip.
It's unclear how Obama could have made the visit at all, given the Pentagon's directives. No Senate staff was on the trip, and the Obama camp says they received the Pentagon's directives on Wednesday, after they were already abroad.
...while McCain chides Obama for making time to go to the gym and not time to visit with the troops, the image used in the ad is Obama shooting hoops in Kuwait— with the troops.