My reading is that the intent of dispel magic is to remove magical stuff cast onon a person, not necessarily magical stuff cast byby a person.
In the case of spiritual weapon, the effect is not on the caster, it is in the air tens of feet from the caster.
I would apply this to other spells, for example arcane eye and, the various image and illusion spells, buffing/cursing spells like bless and bane, glyph of warding, sanctuary.
I would also say that detect magic cast near someone using spiritual weapon would show the magic aura on the weapon, not the caster.
If you did rule that this worked when targeted on the caster then you'd have to decide whether or not casting dispel magic on the effect also works. For example, do you allow casting dispel magic on the spiritual weapona blessed/baned person or on the caster or on both?