Can I assume that Electrum did work before for you not showing such a behavior, ie. a deposit to your Electrum wallet went fine without an immediate "sweep away" transaction to some unknown destination address? If yes, when did this stealing after deposit start?
Can you remember what might have caused this behavior of your Electrum wallet to begin with?
Did you ever enter your wallet's recovery words on an online website, maybe persuaded by some entity without knowing that this is an absolute no-go?
How and where did you backup your Electrum recovery words? Ever saved them on an online digital device? Ever taken digital pictures of them?
I suspect a compromisation of your recovery words, especially when the stealing transaction appears almost immediatelly when the deposit transaction into your Electrum wallet isn't even confirmed (both are at first unconfirmed until they get mined into a new block). But it could also be malware on your computer or you didn't download a genuine version of Electrum.