In a large enough war, space infrastructure would actually be very vulnerable. Imagine a cloud of a few tons of shrapnel, spread around in an orbit that intersects all the 550km orbits of the Starlink constellation. This shrapnel cloud could be deployed with a single launch.
It's not that simple. Because enemy nation states also have their own satellites. They will just be damaging their own infrastructure, specially Russia with their huge land to cover they need their satellites.
I think these things would happen as a result of a process of escalations, not as a result of rational decisions.
Perhaps one side temporarily blinds a spy satellite with a laser[1], to prevent it from observing something sensitive. Then the other side reacts by blinding another satellite in the same way, but oops, the laser was a bit too powerful and it does permanent damage to the sensors. Then a single satellite is outright destroyed in retaliation. Etcetera.
The solution, I think, would be to have redundant terrestrial communication links. A spiderweb of links between nodes, with routing around damage. And fallbacks to slower microwave or radio links when fiber gets cut. And developing plans to make due with very low bandwidth (i.e. text based protocols) during a crisis.