JWST would be totally useless as a spy satellite. It sees in IR. It is in space specifically because IR does not penetrate the atmosphere very well. That applies when looking down equally as up. Everything from the mirror and sensors to the entire cooling operation is optimized to see that IR blocked by earths atmosphere. So any spysat version wanting to actually see through that atmosphere would share almost nothing in terms of design or parts.
This is what real spysats looks like. They make JWST look like a toy.
https://en.wikipedia.org/wiki/Orion_(satellite)
"is according to NRO director Bruce Carlson "(...) the largest satellite in the world".[3] It is believed that this refers to the diameter of the main antenna, which might be well in excess of 100 m (330 ft)."