By the time that the Spanish-American War happened, westward expansion within the continental United States was over. The Indian Wars were finished and the frontier was officially closed. This, one can argue, helped to bring about the war.
This happened in two ways. First, with no new land left to conquer, the US was going to have to look overseas to find a way to expand. This can be credited with helping push the US towards wanting to intervene in places like Cuba and the Philippines. Second, it left the US with no outlet for its aggressive tendencies. People like Theodore Roosevelt felt that America needed to be toughened through war. With no Western lands to open and Indians to fight, it was necessary to look overseas for this as well.