When a medium creature is caught in the air elementals whirlwind attack can a spiritual weapon still attack the creature caught up in it? I would say no due to the rule if it touches the ground the caster doesn't have a visual due to debris but what about in the air?
If the whirlwind’s base touches the ground, it creates
a swirling cloud of debris. This cloud is centered on the
creature and has a diameter equal to half the whirlwind’s
height. The cloud obscures all vision, including darkvision,
beyond 5 feet. Creatures 5 feet away have concealment, while
those farther away have total concealment.
If you can't see the target, you cannot direct the weapon to attack them. If the weapon itself 'leaves your sight' (ie. Because it follows its last target into the cloud) it returns to you. If a target you've already directed it to attack is out of your sight but the weapon isn't (ie. It's attacking from the edge of the cloud and just has concealment to you), then it continues to attack.