The Spanish-American War had many different causes.
The immediate cause of the war was the explosion of the battleship USS Maine in Havana, Cuba. This, coupled with what the US saw as an unsatisfactory response by the Spaniards, led to the war. However, there were deeper causes to this war.
One major cause of the war was American sympathy for the cause of the Cuban rebels. Americans were naturally disposed to support rebellions against what they saw as tyrannical European rule. They were particularly unhappy with Spain because they felt the Spanish were treating their Cuban subjects quite brutally. This feeling was whipped up by the “yellow journalism” of the time.
Another major cause of the war was the desire on the part of many Americans for a war. There were two main reasons for this. First, some Americans, like Theodore Roosevelt, felt that Americans needed to fight a war to improve their toughness as a nation. They felt the country was becoming too soft and needed to challenge itself. Second, there was also the feeling that the US should gain itself an empire. Some Americans, like Alfred Thayer Mahan, wanted the US to take an empire so that it would be militarily stronger than it had been.
These were the major causes of the Spanish-American War.