That and in the future we'll apparently forget everything we ever learned about electrical codes and the proper way to build things so they don't spark and catch fire at the slightest provocation.
I actually saw a reasonable explanation for this once: battleshort[1].
That is, sometimes equipment has its fuses bypassed because under battle conditions it is better to have the equipment working in a dangerous state, than not working at all.
So when the ship goes to red alert all the major systems are automatically put in battleshort mode. So a couple of ensigns die rather then the weapons stop working because a fuse blew.
Also, Star Trek uses a plasma grid to distribute energy, not simple electrical lines. I think I remember reading somewhere (this may have been fan theory) the sparks flying off are a pressure-release so it doesn't just straight explode.
That is a very old-school approach so. But it could be an in-uniberse explanation. Overall so, Federation, and Star Trek equipment in general, just seems so incredibly unsafe. Very easy to jury-rigg repairs and modify it so, especially the shield generators!
That is, sometimes equipment has its fuses bypassed because under battle conditions it is better to have the equipment working in a dangerous state, than not working at all.
So when the ship goes to red alert all the major systems are automatically put in battleshort mode. So a couple of ensigns die rather then the weapons stop working because a fuse blew.
[1]: https://en.m.wikipedia.org/wiki/Battleshort