Andrew Jackson lost the election of 1824 because, though he received a majority of the popular and electoral votes, his margin was not great enough for a win, and the constitution directed that the election had to be decided by Congress. Henry Clay, one of the candidates, gave his support to John Quincy Adams, another candidate, and Adams won the Congressional vote.
The presidential election of 1824 was one of the closest in American history. John Quincy Adams had been secretary of state under President James Monroe. Andrew Jackson was a war hero after the battle of New Orleans in 1815. Henry Clay was speaker of the house and a powerful political presence. After the popular election, Andrew Jackson, John Quincy Adams, and another candidate named William H. Crawford, advanced to the Congressional election, while Henry Clay was eliminated. Adams had a secret meeting with Clay, obtained Clay's support and won the election. Afterwards, he appointed Henry Clay as his secretary of state. Andrew Jackson was furious and condemned the election and its results as "the corrupt bargain."
Not having popular support, John Quincy Adams accomplished little during his one term in the White House. In the presidential election of 1828, Andrew Jackson trounced him, winning over twice as many electoral votes as Adams.