Granted, there have been "malware versions" of popular wallet software that do exactly what you're talking about... they impersonate legitimate software and are designed by the thieves to steal your private keys or your seed or just automatically transfer all your BTC out to their addresses.
However, all the reputable wallets like Electrum and Bitcoin Core etc... are well known, open-source and provide digital signatures for the application executables/installers or digitally signed SHA256 checksums of the same. This allows the user to verify they have a legitimate copy of the application and because of the open-source nature of these applications, it's possible for users to review the code and make sure nothing nefarious is happening in the background.