It is illegal in California to possess a spear onboard any vessel on any day when marlin have been taken (T14, CCR, 28.95). So, while you may technically spear a marlin if you swim out from the beach, you cannot do so from a boat. Since marlin generally occur far from shore, this would be difficult but is presently allowed. Note that “Take” includes attempting to hunt, pursue, catch, capture or kill, so even an unsuccessful attempt to take a marlin with a spear from a boat is prohibited.