The largest barrier to online voting is ensuring that fraud does not occur. Somehow you have to have a method to verify that a user has voted, and identifying that user, while not allowing other users to identify who you have voted for. Also, the method of counting the votes has to be similarly protected. Let me divide this into two portions.
Verifiability of the voter:
This is quite a tricky thing, but there is an analog to it already in place in mail ballots. Most mail ballots have two envelopes which contains the ballot. The outer envelope contains enough information to identify the voter. A ballot worker will take this information, verify the ballot, and then place the inner envelope into the ballot pool. So long as this is managed correctly, it would work.
The analog to this in the digital world would be to encrypt your data first with a public key that only the election office can decrypt (Along with a salt to ensure your data can't be guessed via a collision), and secondly with a signature that you have voted, something that presumably would be mailed to you. Your vote is passed to a computer server, which verifies you are eligible, and haven't voted, which then passes the still encrypted vote portion on to a second system, which records your votes. Still, there is some inherit danger in somehow frauding this system.
There are some systems which allow for calculations on encrypted data, but for the most part, these are not yet ready for prime time. Still, these would allow for an even more secure system, one in which all votes could be public, but no one would know who voted for who.
Counting the votes.
After you have voted, your vote must be counted. But how can you actually verify that the vote was accurately recorded? Paper ballots give real tangible proof that there is something, and are rather hard to discard. Also, the polling places must keep track of the number of ballots used, and return even blank and spoiled ballots. Digitally, it would be quite easy to miss some of these votes, and not count them. Of course, the counting time is quite quick. One could imagine a system of verification by randomizing a large number of votes that were known to go a particular way, and auditing the system, perhaps even on election day, to ensure the system counted correctly.
While internet voting would be a fantastic thing, and the technology is starting to come to fruition, it could be abused, and has thus been taking a slow route. I could have mentioned other topics as well, like fraudulent voting sites, etc, but sufficeth to say there are a lot of complexities, and people who would exploit them. Someday we will get there, but the technology just isn't ready yet.