This comes up a lot, so I'm answering it in detail. It's addressed (subtly) in dialogue, and follows a key theme of the story. If you want a quick read, I wrote a short version on the Film & TV site.

Sansa doesn't want to rule.

Neither does Jon, of course. Neither has shown any sign of enjoying politics and both have suffered horribly from being in the limelight, and (I realise this is unusual for Game of Thrones characters) neither is a psychopathic megalomaniac motivated by lust for power.

We even see a debate between the two, where both encourage the other to step up. Of the two - Sansa and Jon - Sansa is now by far the more skilled politician and manipulator (in the TV show: in the books she's still literally struggling to manipulate stubborn children out of bed), and therefore, Sansa wins.

Jon: I'm having the lord's chamber prepared for you. Sansa: Mother and Father's room? You should take it. Jon: I'm not a Stark. Sansa: You are to me. Jon: You're the Lady of Winterfell. Sansa: You deserve it. We're standing here because of you.

...So first, she convinces Jon to think of himself as a Stark, and makes it clear she doesn't want to step up...

Sansa: I should have told you about him, about the Knights of the Vale. I'm sorry. Jon: We need to trust each other. We can't fight a war amongst ourselves. We have so many enemies now. Sansa: Jon. A raven came from the Citadel. A white raven. Winter is here.

Transcript link

Notice how she artfully creates a subtext where Jon's duty is to step up and lead, and hers is to inform and support him - wrapped up in what looks like an innocent, welcome apology. She's already been playing on what Jon sees as his duty to protect her and her vulnerability. It's much more subtle than what she did with the Royces in season 4, but the principle is the same: playing on a noble man's sense of duty and honour.

The very next scene we see them in, it's Jon (nervously, reluctantly) putting himself forward at the head of the table, and Sansa (smiling) sitting by his side, letting him take the limelight, the pressure, the responsibility, and the risk.

Power resides where men think it resides

I really can't stress this massive, massive theme of the whole story enough - it's essentially the underlying answer to every question of the form "But technically, don't the rules say...".

You've got a room full of passionate Northern lords and ladies, not rule-following robots or book-balancing bureaucrats. They're looking at:

The legendary Northern swordsman (according to Ramsay who has no reason to lie about this) Jon Snow, who was the respected leader of the ramshackle rugged Castle Black, who led the inadequate brave army to Winterfell, who stupidly honourably led an incredibly foolish courageous charge in a doomed noble attempt to save his brother, reminding everyone of the much-loved Ned Stark's unwavering commitment to acts that are likely to imperil his entire family right and honourable. He led the army from the front, led the charge into Winterfell, and personally overcame the feared Ramsay - with his bare hands! He's a living legend in the North, sitting at the head of the table, and is talking like a leader. Everyone is talking about him.

The gentle Sansa, who has spent a long time in the South battling to survive and developing valuable political skills eating lemon cakes and doing whatever soft southerners do. She's sat by her half-brother's side, letting him put his head on the chopping block dutifully supporting his claim to rule. She single-handedly won the entire battle watched the battle from far away, and the faction she won over and directed sent letters to are the only reason they're not all dead not even Northerners. She's not claiming anything. No-one's talking about her, and she seems perfectly happy that way.

A majority consensus is emerging that Jon is enough of a Stark. Sansa might seem more obviously a Stark on paper, but we saw earlier that after her marriages and time down south some (e.g. Lyanna Mormont) question whether she's still a true Stark or more of a "Sansa Bolton" or "Sansa Lannister".

Whatever she is, she seems to support the emerging consensus that Jon should rule, and no-one else has an interest in arguing the point for her. Northern lords aren't the types to say "Maester! Bring the rulebook! Let it tell us what to do". They certainly didn't stop to check they were following correct procedures when they spontaneously promoted Robb from Lord to King.

Who are they going to cheer for?

There's no magic Supreme Court to rigidly enforce the law

In our world, some countries have Separation of Powers and an independent body or bodies like a Supreme Court than can hold all powerful people to account and enforce the Rule of Law. Many countries, sadly, don't, even (or, especially) today. If you're lucky enough to live in one of the countries that does, don't take it for granted and assume that in all nations, in all worlds fictional or otherwise, some magical power ensures that rules are followed even when no-one in a position of power wills it. Rule of Law isn't the norm - it's something people fought long and hard for, and still fight to maintain.

Rule of Law is clearly not strong in Westeros, despite the courageous efforts of a rare few (e.g. Ned, Barristan). If you truly can't believe that various shattered war-torn corners of Westeros don't have some strong, independent power that magically enforces the rules regardless of the preferences of the powerful, ask yourself, where was this power when Mad King Aerys decided "wildfire" was a valid champion for a trial by combat, and turned a trial into an execution? Or when Joffrey granted himself the unprecedented power to overrule a kingsguard's solemn vow? Or when Cersei ripped up King Robert's decree? Those were more peaceful times, in the South, where the infrastructure of the state was still largely functional (multiple great houses, a semi-independent religious order, small council, citadel, maesters, bureaucrats, etc), unlike the war-torn North where this is the third total change in governmental system in a few years. Despite disapproving mutterings, these nonetheless went largely unchallenged.

Would it even matter if there was a powerful, independent arbiter? Suppose Lady Mormont's maester had been a stickler for the rules, stood proud and produced a rulebook with which he passionately argued that Sansa must inherit whether she wants to or not. Suppose the lords had been swayed by this. Nothing would stop newly crowned Queen Sansa simply formally legitimising Jon and abdicating. There's little practical difference here between her giving Jon informal backing as the eldest known living Stark, and her giving formal backing as a "five minute Queen".

It's de facto vs de jure legitimisation. A functional legal system or bureaucracy would care about the difference, but the fact Northern lords don't reinforces something about them we learned when they spontaneously promoted Robb from lord to king without stopping to observe any legal framework or due process. They don't fuss about the details, they act.

Sansa could make a very strong claim here, but it'd be out of character

She's clearly aware she could. Baelish had even tried (creepily) and failed to talk her into it:

Littlefinger: Who should the North rally to, Sansa? A trueborn daughter of Ned and Catelyn Stark born here at Winterfell or a motherless bastard born in the south?

Since everything went crazy in Season 1, all Sansa's actions have been trying to get to a position of relative safety. Before then, her main motivations were lemon cakes and a naive sense of the glamour of knights, courts, kings and castles. She's never shown any interest in power except as a means to try to get a safer or more comfortable position. Even when she was enjoying being betrothed to Joffrey, it was the glamour and false charm that excited her, in stark contrast (see what I did there) to the smart, power-hungry Margaery.

She could easily make a case for herself to be Lady of Winterfell (hell, even Jon wanted her to), but she refused. After everything she's been through, why would she want to be the one in the most dangerous position, under the most pressure, responsible for holding together impoverished factions recently at war facing a fierce winter and a terrifying threat from beyond the wall? Especially considering it appears to be part of yet another elaborate plan by the creepiest man in Winterfell (if it was reverse psychology on his part and this is the outcome he actually wanted, she's not yet smart enough to see through it).

She's finally got a roof and a warm bed, people around her she can trust, and meat and mead to share with them and a table to share it from. She's happy, for the first time since Season 1 (apart from nagging worries about that aforementioned Creepiest Man in Winterfell).

Of course, she does now have this wrathful and impatient side to her personality. It would be perfectly in character if, next season, she took a "backseat driver" roll, constantly feeling the need to intervene every time she sees the less politically astute Jon about to do something she thinks is foolish or weak (a little like she did before the battle). But there's nothing we've seen in her character to suggest she actually wants to sit behind the wheel herself.

In season 7:

This is pretty much exactly what happens. She can't stop arguing with almost every decision Jon makes, even directly contradicting him in front of his bannerman - but is aghast when he decides to leave and put her in charge. Then she finds herself conflicted: she reluctantly finds she's good at playing Lady of Winterfell, and somewhat enjoys the power, but hates dealing with the delicate, dangerous and stressful political balancing she has to do (until, with some help, she has it neatly disposed of...)

Much like Qyburn down south, it's much more convenient for her to let someone she knows she can influence take the personal risks. On that note...

Fun bonus observation

A recurring motif in both the books and the show is similar events happening to very different characters under very different circumstances.

In this episode, we get two scenes which, in some ways, are incredibly similar:

An ashen-faced character is improbably proclaimed to be a monarch in the hall where they spent frustrating years sitting on the sidelines, in front of assembled lords and ladies. They might have idly fantasised about this, once, never thinking it possible, but they're not smiling, because of the tragic circumstances of how they came to be here and the challenge they now face.

Both have claims to the throne that are shaky at best

By their side is an ally who is smiling. This person is in position to be the power behind the throne. They're smarter and shrewder than the person on the throne, and are happy to let them take the danger, pressure and responsibility.

The woman of the two makes uncomfortable eye-contact with a man hanging back behind the main crowd in the left hand side of the audience, with whom she has an uncertain, complicated relationship. They don't know if they can trust each other, and she doesn't know if he'll be a valuable ally or mortal threat.

In season 7: There is a simmering power struggle between the woman and this man, which eventually explodes into an open conflict which ends with the woman ordering the man's execution (with very different levels of conviction and very different outcomes, see below...).

...while in some ways, the two scenes are almost polar opposites: