Alexander Hamilton didn't favor Thomas Jefferson or Aaron Burr. He simply believed Jefferson was rather the lesser of the two evils.
In the past, Burr and Hamilton had been on rather friendly terms. After Burr changed parties and defeated General Schuyler, Hamilton's father-in-law, in the seat for the US Senate, Hamilton and Burr's friendship basically disintegrated.
In the presidential election of 1800, Hamilton advocated Jefferson, basically stating that though both would be dangerous in a presidency, Jefferson will at least stand for his beliefs while Burr will falter and simply chase after higher positions and notability, as he had done to take over the US Senate seat.
Hope this helps! :)