Spiritual Weapon says:
When you cast the spell, you can make a melee spell attack [...]
There is the option to make an attack or not, so going by the wording of Spell Sniper, it shouldn't be affected by Spell Sniper because you are not "required to make an attack roll".
Bigby's Hand (Player's Handbook, p. 218) also includes the phrase
you can [...] cause one of the following effects with it.
Beyond that, it also has multiple options that don't include a spell attack at all, so Bigby's Hand shouldn't be affected by Spell Sniper either; even if the wording of "you can make an attack" doesn't do it, the extra options that don't include attacks should still exclude this from Spell Sniper.
Mordenkainen's Sword is the spell that I was looking at that made me ask this question. Unlike the other two, it says:
When the sword appears, you make a melee spell attack against a target of your choice within 5 feet of the sword.
So based off the wording, you have to make an attack against a close enough target. Is that enough to satisfy the requirement of Spell Sniper? I would think that no, it is not intended to be affected by Spell Sniper in any way. The casting range is tied to summoning the sword, the attack is made after being summoned "When the sword appears." and so is not part of the casting itself. A great comparison is Green-Flame Blade where the attack is made "As part of the action used to cast this spell..."