Everyone seems to have concluded that the ants liked the Coca-Cola because it has more sugar. Actually, it has less sugar. But it tastes sweeter than Pepsi when flat, because it has more salt. The ants preferred Pepsi at the start because it was less carbonated, making it sweeter.
From the comments: