Because in real life, it’s (relatively) easy to have both anonymity and trust. Online, it’s impossible to have both. If you want to trust that the vote numbers haven’t been tampered with, you necessarily need to know everyone who voted.
This is the fundamental problem with online voting.
I said it’s relatively easy. Having both trust and anonymity online is significantly harder than in real life.
However, it is easier to pick one of those and have it online then in person. In real life, total anonymity is really hard. But online you can just use tor or something.