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 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.
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.