The Union and the Confederacy both wanted California’s support, but for different reasons.
California's rich gold reserves were seen as a major asset to the Union. For the Alliance, gold was an extremely valuable resource. Grant famously remarked, "I don't know what we would do in this wonderful national situation without the gold supplied from California," alluding to California's contribution to the war effort. By keeping the Northern war effort well-funded, the state's rich gold mines and pro-Confederate economic elites would ensure the state's financial success. The outcome of the battle would have been very different without this steady stream of gold.
While California possessed a resource the Confederacy desperately needed, it also cared about riches in gold. The Confederacy would have a much-needed open harbor off the coast of Southern California undisturbed by the Confederate Blockade. In addition to having gold, Southern California's harbors were desirable due to the Confederacy's blockade of all Southern ports. With no easy access to Europe, the South lacked both a market for cotton exports and a source for importing military supplies. So it can be concluded that the Union and the Confederacy both wanted California's support, but for different reasons.