Travelling as a passenger on a freighter from Europe, including Spain, to the US is easy to arrange. Price is about €100 per day and crossing the Atlantic ocean should take a couple of weeks so you should expect to pay €1200-1500 (how much exactly would depend on the exact route, insurance and port fees, etc.) You can find many details on this site, e.g. Where can I get information on freighter travel?
I know little about actually working on a large cargo ship but as far as I know, it would typically go through a local recruitment agency in places like the Philippines that would fly you wherever you are needed. You would then stay on the ship for 3 months or so and you would not even always have time to go on shore when calling at a port. You would of course need some qualifications and appropriate documentation to be hired.
You cannot choose a route or embark for a single leg, that's too much of a hassle for the shipping line, even if you assume you would be able to do useful work and save them a little bit of money on wages. Consider this: If your work is really needed to keep the ship moving, you would need to be replaced wherever it is that you are planning to disembark. And container ships stay a few hours, perhaps a day or two in the largest harbours at most, maybe up to a week for bulkers and tankers. How could a ship be waiting for volunteers to show up? Better fly in a cheap worker with a predictable schedule to make sure you are not wasting time.
And if your work isn't absolutely needed, why would you be offered a place on the ship at all? You could hurt yourself and end up costing a lot. Paying passengers actually pay insurance against loss of profits due to the need to deroute a ship in case of emergency.
The thing is that there isn't really anything in-between: Showing up in a port and hoping to find a ship going somewhere you want to go and letting you work to pay for your passage doesn't happen anymore, at least not with commercial freighters. You might have more luck with small sailing boats but here again some experience would typically be needed.