Because during the Cold War and after, encryption was for important and secret stuff. They used to require large probably expensive and heavy machines to perform encryption on what was just text messages. From a quick google search, here's a machine from the 1990s: https://www.cryptomuseum.com/crypto/usa/kiv7/index.htm (look at how low its bandwidth is). And in Star Trek (I assume) they're doing encrypted audio and video which I assume wouldn't be very achievable until some time in the last couple decades.
It's only pretty recent as far as I know that a "CPU" has built-in encryption support (like x86_64 having AES-accelerating instructions)
Police radios in the US still don't always use encryption.
And no matter how fast it is, encryption requires more computation and thus power consumption than not encrypting something.
Of course that still wouldn't justify some of the quotes above. But movies have to kind of play up some things to make them interesting.
In the 1970s they didn't have encrypted live audio video communication in outer space which is what they're showing in Star Trek. It was literally future technology until the last couple decades. And now we can do it all the time since our computer CPUs have it built in.