The double-entry visa was created exactly for this situation: a trip to the UK – at the time a non-Schengen EU member – in the middle of a trip to the Schengen area. Whereas multiple-entry visas are supposed to be issued to trusted travellers who have demonstrated a need to visit the Schengen area frequently, there is no requirement of that nature in the regulations regarding double-entry visas. The double-entry visa is really a special type of single-entry visa issued for a specific trip and absolutely the right solution in this case.
That said, one tricky thing is to make sure the Spanish consulate understands the person really does need a visa covering the Frankfurt leg of the trip even though it's only airside transit. If the traveller is a Cuban citizen then the consular officer should be able to figure it out as even an airside transit requires a visa in both Germany and Spain so that it's clear that a spent single-entry visa would not be enough. But if the visa is only required because of self-transfer or some other reason, it would be easy to miss. In any case, you may want to spell all that out, e.g. with a cover letter.
Once that is clear, Spain has to choose whether they should issue a visa for the whole trip or not. They can issue whatever they feel like no matter what you checked on the form but there is no single-entry-plus-a-transit visa. If they do want to cover the whole trip, then they should issue a visa for two or more entries. If they don't want to, then they can issue a single-entry visa and force the traveller to apply for a separate German airside transit visa. But in my view they should have no qualms about issuing a double-entry visa.