We gamble because we experience the hope of winning, in some cases such as a lottery ticket, winning more than we could ever otherwise hope to obtain. The payback for gambling is hope and dopamine.
A recent study in the Journal of Neuroscience, Gambling Severity Predicts Midbrain Response to Near-Miss Outcomes, provides additional detail. The study found that a near-miss (or the perception of almost winning) produces the similar neurological reward as a win with the effect being most intense in problem gamblers. Check out this article on the Telegraph for an overview of the study.
The continued hope of winning is what keeps us gambling because the mental energy (excitement, adrenaline and dopamine) is nearly equivalent to what we get for a win.