Every time I’ve heard this song played it always seems to be in the same key. Is there some agreed-upon standard, or some rule, that suggests it’s always in G major? Wikipedia seems to think it is the "correct’ key but doesn’t elaborate.
“The Star-Spangled Banner” is often in different keys, I think primarily because it’s got a wider vocal range, and consequently harder to sing; key is adjusted up or downfor the vocalist. As far as I know, there’s no rule for what key the American anthem is to be played in.
There is a standard (but unofficial) arrangement of the Star Spangled Banner that was originally created for US military bands. In high school and college bands that was always the version we had to have memorized, and it was always in the same key (though I can’t remember what key that was at the moment). I was told by the band director that we had to know that standard version because if you were in a group of musicians from another band you could instantly play the anthem together without too much fuss. This happened several times when playing with regional ‘all-star’ bands or at several events that had multiple marching bands that played the anthem at the same time.
But you are right in that there is no official standard, and plenty of alternate arrangements. And it does change when playing with vocalists instead of only musicians.