I would keep the apellido materno in place, the key issue is to leave the USA on the same passport as the arrival ESTA, so ideally get the correct German name and passport in the API fields and present the German passport at SFO. They will know very well in SFO how Spanish naming conventions work.