The writing is imprecise, but not incorrect
The meaning is clear from context - you are permitted to do either without having to do both
Consider the sentence:
He lives in Maine and fishes.
What does this mean? He lives in Maine, and He lives in fishes? Well, it could mean that. But it probably means He lives in Maine and He fishes.
One of the uses for "and" is when you have a compound predicate - a sentence with one subject and two verbs. Then the "and" distributes the subject to both predicates.
Now, it certainly would be more clear and more precise to say "He both lives in Maine and he fishes." But I can save myself some time and text by writing just "He lives in Maine and fishes." Given how unlikely it is for someone to live in a fish, I am probably not going to be misunderstood, so the brevity may be worth the lack of clarity.
Now consider the sentence:
I like pickles and ice cream.
This is not a compound predicate, because there is only one verb, "like". And there is only one subject, "I". But it is still a compound sentence in a sense, because "and" is distributing the common subject and verb across the two objects. This sentence probably means I like pickles, and I like ice cream, too. Unfortunately, it could also mean I like the combination of pickles and ice cream. Given the context (the unlikely combination of flavors), it probably means the first. However, the original sentence is grammatically correct regardless of which meaning it has, because "and" can mean slightly different things here.
If I wanted to be precise and clear, I could write either "I like both pickles and ice cream" or "I like pickles and ice cream together," depending on which I actually meant. To be perfectly clear, I would have to use more words. But if I meant the first, that I like both flavors but not necessarily together, I can probably get away with the shorter sentence without misleading the reader.
Finally, consider the sentence:
I like bread and butter.
Grammatically, this is exactly the same as "I like pickles and ice cream." But here, the context has shifted. Bread and butter, unlike pickles and ice cream, are often enjoyed together. When I write I like bread and butter, most people are going to assume that I mean I like bread together with butter and not I like both bread and butter but not necessarily together. The exact meaning of "and" has shifted here, and my only clue to that shift is context, not grammar. The sentence has reached a tipping point; if I really want people to understand the more unusual reading, I now need to add enough words to be more precise.
So now let's look at the text of spiritual weapon:
As a bonus action on your turn, you can move the weapon up to 20 feet and repeat the attack against a creature within 5 feet of it.
This could mean:
As a bonus action on your turn, you can move the weapon up to 20 feet. Also as a bonus action on your turn, you can repeat the attack against a creature within 5 feet of it. You can also do both of those things for the same bonus action.
Or, it could mean:
As a bonus action on your turn, you can both move the weapon up to 20 feet and repeat the attack against a creature within 5 feet of it but you can't do one unless you also do the other.
Either one of these meanings follows grammatically from the actual text. But which is more likely given the context?
In 5e combat, typically someone can Move, and can Attack, independently. You can even break up your move between attacks. Doing one is not typically dependent on doing the other. Thus it would be strange to have a spell that creates a weapon that allows you to attack, but only if you move it, and allows you to move it, but only if you attack. Certainly spells are almost always exceptions to rules or expectations; they are "magic", after all. But if a spell is going to change some fundamental concept about how an attack sequence works, it should have pretty clear language about how it does so.
Thus, it seems likely that the writers of the PHB decided to economize some space by allowing the "and" to distribute "As a bonus action on your turn, you can" between two separate and independent predicates: "move the weapon up to 20 feet", and "repeat the attack against a creature within 5 feet of it". It seems rather less likely they meant that in order to do either, you have to do both.
The following is left as an exercise for the reader. A gnoll has the Rampage trait:
Rampage. When the gnoll reduces a creature to 0 hit points with a melee attack on its turn, the gnoll can take a bonus action to move up to half its speed and make a bite attack.
Can a gnoll use its bonus action rampage to move without attacking?
To attack without moving?