States administer election rules and aggregation, but local municipalities handle voter registration, management of voting locations, and vote collection and tabulation. Each one can have their own separate rules or nuances, which have to conform to overall state regulation, but still allow for variation. With variation and lack of standardization, you get the possibility of variation and error in the process.
Lotteries generate revenue. A lot of revenue. As such, they are able to fund having uniform, standard, state of the art equipment and systems. Elections do not generate any revenue, and having the best equipment and systems is often seen as a luxury or largess. Machines are often old, malfunctioning, and there is a huge amount of variation within a state, let alone between states, in the types of machines that are used.
Lottery sales are pretty constant, and all the employees at outlets have to do is push a button on a machine and collect money. Election polling places are manned by volunteers who then have to answer questions in legal grey areas or help people with problems that exceed the volunteers' expertise or knowledge, and they have to call upon this expertise very infrequently, often for different types of elections when they do.
Elections are often managed by public officials whose continued success as public officials depends upon their systems not working optimally for selected portions of the population who are likely to vote against them. They have a vested interest in the elections not working properly for those selected populations. If I'm in charge of a system that I don't want to work optimally, it should not be surprising that the system does not work optimally.
Finally, a purchaser of a lottery ticket has zero personal input on the lottery ticket, itself. Yes, they often can choose their own numbers, but the ticket that is produced is a standard, controlled document that is produced by the system. If I mis-mark my number selection form, the ticket will reject, just like a ballot might, or it will record my input incorrectly on the produced ticket, just like a voting machine would. In this regard, it's not that different.
Those mistakes are more prominent in voting systems because each entry is noted and recorded. In a lottery system, it only becomes a large issue on a one in a hundreds of millions basis, and any kind of issue at all on a very infrequent basis, and mostly at a very trivial level. If there is a problem where I think my desires were not handled properly, my participation in the lottery is entirely discretionary on my part, subject to the terms and conditions set up by the lottery, so rejection of my complaints that my wishes were not properly followed allows for less recourse or potential mitigation than a system where I am exercising a fundamental right in society.
MegaMillions: How to Play (winning odds)
Powerball: Main Page (odds of winning link at bottom of page)
To sum up - there are vast differences between how the systems are set up and operate, and to the degree that they are similar in important ways, the frequency problems are noticed and importance of problems, between the systems, is also different.
There's not a lot that is equivalent or comparable there.