Because someone else was also voting when you cast your vote, most likely. You sent your vote in, and the server responded with the current vote tally.

Or not.

Yes, that's it. You don't see the current vote total until you vote or refresh the page, so it might look like your vote is counted more than once (or not counted at all). In reality, it's just that other people have voted between the time you loaded the page and the time you voted.