Spiritual Weapon ignores Cover (but not Visibility) between the Caster and Target
The Cover rules state:
A target can benefit from cover only when an attack or other effect originates on the opposite side of the cover
Spiritual Weapon indicates that the weapon itself is attacking the Target, so only Cover between the Weapon and the Target matters.
However: Visibility is still determined based on the Caster to Target. This is supported by Jeremy Crawford's statements:
The spell doesn't require you to see its target. It follows the normal rules for attacking a target you can't see.
Questioner: caster could leave the room and leave a spiritual weapon floating in the doorway for a minute w/ disadv to hit?
Crawford: Yes, assuming there's actually something there to hit.