Security and cost are significant problems. However another significant problem is that online elections will favor one group of voters (generally young, educated, and not poor) over other groups of voters. As it is everyone must (a) get off their butts and travel the couple of blocks to vote or (b) take the time and effort to request an absentee ballot. Thus lazy people generally don't vote. Suddenly switching to a method that will have many more lazy voters and a lot fewer eldery voters can be a huge swing in votes that neither political party is willing to risk.
Note: lazy vs elderly is just an example. I could have gone with rich with computers vs poor without them. Or any other potential huge voter swings that may exist.