Is a swarm of wasps immune to the magic weapon created by the Spiritual Weapon spell?
Spiritual Weapon says that it's considered a magic attack:
It strikes as a spell, not as a weapon, so for example, it can damage creatures that have damage reduction.
Swarms say this about being attacked by spells:
A swarm is immune to any spell or effect that targets a specific number of creatures (including single-target spells such as disintegrate),
So by RAW, Spiritual Weapon can't hit a swarm of any size, not just diminutive ones.