What did president McKinley's assassination have to do with the Spanish American War?

I do not think was a connection. The assassin was an anarchist - part of a international movement at that time that opposed all government.