Q 378a: Can a spell be used with a Shield Guardian's Spell Storing ability if the spell cannot be cast in a way that targets the Shield Guardian? Strictly speaking, the spell doesn't have to 'target' the Guardian, only be cast 'on' it. However, the phrasing that the caster "must" cast the spell on the guardian implies that if a spell cannot be cast on the Guardian, it is an ineligible effect for the ability.
Q 378b: Can a spell be used with a Shield Guardian's Spell Storing ability if the spell would not work on the Guardian? Could you store a Cure Wounds or Charm Person in it?
Outside RAW, I like to imagine you fulfil 'casting a spell on the guardian' by standing on the guardian while casting the spell.