Okay, based on what I've learned here, I think I understand why you're asking this question - it looks like it boils down to the fact American television and anime use the word "season" differently.
The way anime is produced nowadays is that the production of a second season is almost always strongly contingent on the commercial success of the first season. As such, production will typically halt completely in between seasons - different seasons are different productions. What this means is that what anime watchers call "seasons" are what American TV watchers call "series".1
And this, I think, is the important insight. It is rare for American television to feature shows that have multiple series (separated by halts in production) set in the same continuity, since American television production functions differently. American shows typically semi-continuously churn out new content (a la The Simpsons) until they get cancelled.
In the specific cases you used as examples (Railgun, Zero no Tsukaima, Medaka, SAO, OreImo, K-ON), it looks like all of them experienced halts in production between each season.
I mean, I understand that the title stays the same for long running series, like Bleach or One Piece...
Right, and the key factor here is that Bleach and One Piece are each one continuous production - because there was never a halt in production, they never got a new title.2
The source material keeps its name throughout its entire life (e.g. there was never a Naruto: Shippuuden manga or a Shakugan no Shana III light novel), so why do their anime adaptations get different titles?
So again, this boils down to the fact that the Naruto manga and the Shakugan no Shana light novels were each one continuous production (as basically all manga series and light novels are). There's no logical breaking point at which to change titles in these cases.
I'm particularly interested in the last two, where the only noticeable difference in the title is a punctuation mark.
The practice of using a punctuation mark rather than a subtitle or other designation to identify a new season is a stupid practice that has been "trendy" recently, and should (with any luck) die out eventually. Still, the idea is basically the same - K-On!! could just as well have been called K-On! 2 or K-On!: This Time It's Cuter or whatever - anything to indicate that it's a separate production from the original series K-On!.
Is there a legal thing in Japan which disallows a production for one "season" to have the same name as another, for clarification purposes?
I'm no expert on Japanese law, but I would be astounded if this were the case.
Addendum: the case of Fairy Tail is interesting - it ran from Oct 2009 to Mar 2013, then stopped for a while, and picked back up again in Apr 2014. Despite this, the name of the series did not change - it was called Fairy Tail both before and after the break in airing.3
My suspicion here is that the break in airing had been planned in advance, and that the producers had planned to resume airing once the manga had had some time to get ahead.
If this is in fact the case, there would have been no reason to halt production during the break in airing - it was already known at the time airing stopped that they would be making more episodes. Contrast this with e.g. Railgun - when the first season finished in 2010, they didn't know (for sure) that they'd be making a second season (which didn't end up happening until 2013).
1 In most cases, anime has no notion that is equivalent to what American TV watchers call "seasons"; the major exception would probably be long-running children's anime (think Doraemon, Sazae-san, etc.).
2 This explanation doesn't really work for Naruto vs. Naruto Shippuden, though, and I'm not familiar enough with that show to posit an explanation. You might like to ask about that particular case separately if it interests you.
3 Regarding which, see this question.