It did not become possible to encrypt voice communications in practical ways in the field until well after WWII (during WWII, the state of the art was SIGSALY - a SIGSALY terminal weighed about 50 tonnes).
As the equipment became cheaper and more portable, it was able to displace encrypted Morse code communications.
Morse also began to be replaced by various forms of telegraphic data communication that were being developed, and provided much higher transmission rates.
Two questions:
What was the last conflict in which Morse was used extensively?
Which contexts continued to use Morse the longest? (I'd guess, aviation and espionage, where portability and size are factors.)
(According to Wikipedia, "As of 2015, the United States Air Force still trains ten people a year in Morse." I wonder how much they use it.)