DBWI: Spain neither keeps its American Empire nor supports the Confederacy

As we all know, the American Civil War was a major turning point for the Union's relationships with the main powers in Western Europe. Most notably, the restoration of relationships with the UK and the deterioration of relationships with Spain. In no small part because Spain was attempting to use the Confederacy as a buffer state to keep the Union from trying to take over New Spain. Of course, that went downhill and soon the US took large parts of New Spain and Cuba.

But what if Spain decided nothing was worth propping up the Confederacy? Or if they lost most of its empire beyond Cuba to begin with?
They only kept a hold of Mexico and the other states by sheer dumb-freaking luck. Or rather, playing off the elite over in New Spain. Then Karl Marx got introduced and the mestizos, indigenous and former slaves basically pretty much crushed Spain's hold over them. The US was more than happy to help, even if it was basically socialists. All they wanted was recognition of the control over the territories they already had (the San Francisco Bay compromoise helped divided the West coast between them).

Spain getting onvolvedwith the Confederacy basically was an alliance of convienence, given how Catholics were still treated and the Union saw it as a full-blow act of treason for the thing. The Second American Civil War saw the US and Mexico annhiliate the South and given how Mexican socialists soon supported American socialists, reconstitution was a lot mroe thorough than people were planing back then.

Spain not backing the confederacy would've delayed the inevitable.