The Spanish American War was the result of American expansionist goals and policies colliding with territories under Spanish control.
American sugar planters had established plantations on Cuba and Puerto Rico as early as 1870 even though the island was technically the property of Spain. By the 1890’s, political leaders and other pro-expansionist groups were keen to annex these islands. They decided the U.S. should enforce the Monroe Doctrine and remove Spain from the western hemisphere.
American newspapers helped fuel the fire by reporting on Spanish “atrocities” that were highly exaggerated. As these stories became more and more sensational, American public opinion turned and soon American were willing to go to war with Spain to help the Cuban people. This was why President McKinley eventually ordered the battleship Maine into Havana harbor.
On February 15th, 1898 the Maine exploded. Since nobody was really sure why it detonated, the American government used the opportunity to claim it was a Spanish bomb and used the event as an excuse to call for war.
Faced with growing pressure from both the public and Congress, McKinley eventually asked congress to declare war in 1898. The Spanish-American War was on.