Brew definitely offers Electrum installation options, now the only question is whether anyone uses this method to distribute fake wallets. Since you did not make a signature verification and did not download the program from the official site, it seems that this is the reason why you were hacked. Of course it is possible that you took the wrong step elsewhere, but my bet would go in this direction.
https://brew.sh/