A lot of the rhetoric leading up to the Spanish-American war was specifically about liberating Cuba, so it would have looked pretty bad to reneg on that after the war, even though annexation was what a lot of people did want. No one really knew anything about the Philippines so people didn't care so much about how that was resolved. Source is either the DKG Roosevelt book or the proud tower by Tuchman.
Well, the very short version is that the Teller Amendment (to McKinley's request for war) specifically denied any intentions of Cuban annexation. The war could thus be painted as a selfless and humanitarian endeavor to liberate Cuba.
It was fairly complicated, as these things always are. Sugar interests in the US opposed annexation out of protectionism. A strong anti-imperialism lobby did not want any territorial aggrandizement for moral reasons. Others feared that annexation would make the US liable for Cuba's large debt.
Annexing the Philippines was contentious, but not specifically prohibited by legislation. Imperialists won out in the end, boosted by nationalism, a desire for new markets and access to China, and, ironically, the outbreak of Philippine-American War. The US received the islands, along with Puerto Rico and Guam, as a part of the Treaty of Paris, for a payment of $20 million.
See Thomas Paterson et al, "American Foreign Relations: A History to 1920" (2000), 215-220