Because you need to both know the value of an action (ie, which politician the vote is counted for) and you need to hide who did the action (to keep the ballot private) and you need to ensure every voter only does the action at most once and you need to ensure that if the machine is replaced or subverted physically that the vote can't be silently switched.
No matter how you dice it, one of those things gives with electronic voting, even if you had electronic voting machines with no state (all pure circuits, say), but especially with votes on machines like personal computers, where a myriad of systems need to be trusted for the vote to register.
It isn't worth it. Paper ballots are intelligible to everyone, and even when we vote by mail there is such a paper trail it is hard to fake.
Generally, by sealed envelopes, and by having groups of people inspect mail votes at counting time to ensure the envelopes haven't been tampered with. There's also usually a paper trail from the post office that receives the votes so you can't just show up with a couple of thousand "mail votes" and send them in.
It is obviously less secure than voting in person, but it's good enough, and your in-person vote supersedes your mail-in vote.
Here's link to King County (Seattle) elections and how they work. Ballots come in by mail and can be dropped off at county owned lockboxes. This video shows how ballots are secured and counted.
In my piece of Floriduh a non-expert franks the signature on the envelope. It's still more secure than voting in person as state law prohibits inspection of paper ballots in a recount; The only regular ballots recounted are the machine-generated totals.
No matter how you dice it, one of those things gives with electronic voting, even if you had electronic voting machines with no state (all pure circuits, say), but especially with votes on machines like personal computers, where a myriad of systems need to be trusted for the vote to register.
It isn't worth it. Paper ballots are intelligible to everyone, and even when we vote by mail there is such a paper trail it is hard to fake.