No, Spiritual Weapon Doesn't Require the Deity Class Feature
The evidence for this in the Core Rulebook is somewhat scant. When a statblock requires a class feature it is phrased as noun. For example, the harming hands Cleric feat (pg. 121) says :
Prerequisites: harmful font
This is not a phrase, like Spiritual Weapon. If it had meant that you should possess the Deity class feature it would be phrased similarly.
Lost Omens Gods & Magic clarified this more. The "Character Options" section starts with an introduction which explains that spells, items, feats, etc. that require faith are largely for flavor, rather than mechanical, reasons. This is formalized in blocks by requiring the worship of a deity. The Feats section of that book (pg. 105) is full of feats that require worshiping deities with specific traits. As the introduction to that section says:
While champions and clerics have ties to their chosen deities and gain definitive benefits from them, they don't hold a monopoly on such abilities. The following feats represent ways all characters might benefit from adherence to a deity or a particular philosophy ...
Therefore, it must be true that clerics and champions (who have the Deity class feature) are not the only classes which can access spells, feats, et cet. that require worshipping a deity. This confirms the text.
Spiritual Weapon Requires Worshipping a Deity
So what does it mean to "have a deity". There is no special magic to this phrase, but the Core Rulebook (pg.29) explains the relationship between player characters and deities:
Write down the deity your character worships, if any. Champions and clerics must worship a deity. ...
If your character worships a deity (a phrase not defined in any stat block anywhere), then they may use Spiritual Weapon. The class feature can't be what allows access.