During the vote for the 998th Lord Commander of the Night's Watch we see a tie between Ser Alliser Thorne and Jon Snow. All of the brothers had voted blindly by placing a token in a jar. However, when the tie is revealed, Maester Aemon votes and breaks the tie in Jon's favor. Why did Maester Aemon not vote at the same time as the other brothers and instead get to vote after the other votes were already counted?
This appears to be a show only event and as such it is likely there just to build tension. As this is the case we most likely won't be able to find the reason as the show doesn't really explore the extended material and it doesn't appear to be addressed in the books. However, in the books Jon wins a landslide victory so there is no need for a deciding vote if that ever happened.
The rest was arrowheads, a torrent of arrowheads, a flood of arrowheads, arrowheads enough to drown the last few stones and shells, and all the copper pennies too.
When the count was done, Jon found himself surrounded. Some clapped him on the back, whilst others bent the knee to him as if he were a lord in truth. Satin, Owen the Oaf, Halder, Toad, Spare Boot, Giant, Mully, Ulmer of the Kingswood, Sweet Donnel Hill, and half a hundred more pressed around him. Dywen clacked his wooden teeth and said, "Gods be good, our Lord Commander's still in swaddling clothes." Iron Emmett said, "I hope this don't mean I can't beat the bloody piss out of you next time we train, my lord." Three-Finger Hobb wanted to know if he'd still be eating with the men, or if he'd want his meals sent up to his solar. Even Bowen Marsh came up to say he would be glad to continue as Lord Steward if that was Lord Snow's wish.
A Storm of Swords, Jon XII
Also in the books a man needs two thirds of the votes not just to win by one and until that happens the voting continuously takes place. This furthers the claim of this being a show only event so we're unlikely to find any new information.
Sam, you're a sweet fool, he could hear Jon saying, all the way back to the maester's keep. Open your eyes. It's been happening for days. Could he be right? A man needed the votes of two-thirds of the Sworn Brothers to become the Lord Commander of the Night's Watch, and after nine days and nine votes no one was even close to that.
A Storm of Swords, Samwell IV
Out of universe: it provides some good dramatic tension, as well as an eloquent way of communicating just how close the vote was, and how divisive the outcome.
In universe: I can't find any sources as to whether or not Maesters hold a special role as tie breaker, but it's very possible that there's a real-world parallel to the office of Vice President of the United States, who also holds the title of President of the Senate. It is a position that does not have a vote except in the event of a tie.
Indeed, the episode seems to at least imply the tie breaker role. Note he appears to be the one presiding over the vote, and is never shown leaving his seat until informed of the count:
6:35 for the start of the vote casting, 7:12 for the resulting tie, 7:40 for Aemon's vote.
EDIT: TheLethalCarrot's answer shows that the entire scenario only exists within the show, and not in the book. With that, it's unlikely that we'll find a definitive answer beyond what we've seen.