Q:

What is the origin of interstellar human civilisation as a "Federation" in science fiction?

It is a common trope in science fiction that the futuristic human civilisation originating from planet Earth is frequently known as "The Federation". Examples include:

The United Federation of Planets in Star Trek
The Earth Federation in Gundam
The Terran Federation in Starship Troopers

Many science fiction games (including many low quality throwaway titles exploiting trends for quick profits) frequently label humanity's main representative faction towards other species in galactic politics as "The Federation" or similar. An example I can think of off-hand is the rogue-like FTL: Faster Than Light I've recently played, where the humans' factions are the Federation and the Rebels (probably revolting against the Federation and are likely thus its former subjects).
What is the origin of human galactic civilisation as being called "The Federation" and how did it become so popular in science fiction works?

A:

There is a multispecies "Federation of Stars" in Edmond Hamilton's Interstellar Patrol series, beginning with his novelette "The Star-Stealers", first published in Weird Tales, February 1929, available at the Internet Archive, and reprinted in Avon Fantasy Reader No. 6, 1948, also available at the Internet Archive. The Interstellar Patrol stories were collected in Hamilton's 1965 collection Crashing Suns. The excerpts below are from "The Star-Stealers" (emphasis added).

It was the yellow star that I was watching, now, as our ship fled on toward it at eighty times the speed of light; for more than two years had passed since our cruiser had left it, to become a part of that great navy of the Federation of Stars which maintained peace over all the Galaxy. We had gone far with the fleet, in those two years, cruising with it the length and breadth of the Milky Way, patrolling the space-lanes of the Galaxy and helping to crush the occasional pirate ships which appeared to levy toll on the interstellar commerce. And now that an order flashed from the authorities of our own solar system had recalled us home, it was with an unalloyed eagerness that we looked forward to the moment of our return. The stars we had touched at, the peoples of their worlds, these had been friendly enough toward us, as fellow-members of the great Federation, yet for all their hospitality we had been glad enough to leave them. For though we had long ago become accustomed to the alien and unhuman forms of the different stellar races, from the strange brain-men of Algol to the birdlike people of Sirius, their worlds were not human worlds, not the familiar eight little planets which swung around our own sun, and toward which we were speeding homeward now.

The headquarters of the Federation, on a planet of Canopus, are described here:

Down we sped toward the mighty structure's base, down over the great buildings on either side which housed the different departments of the Galaxy's government, down until our ship had come smoothly to rest on the ground a hundred feet from the tower itself. Then the ship's hull-door was clanging open, and a moment later I had stepped onto the ground outside and was striding across the smooth sward toward the mighty tower. Through its high-arched doorway I passed, and down the tremendous corridor inside toward the huge doors at the end, which automatically slid smoothly sidewise as I approached. The next moment I had passed through them and stood in the Hall of the Council itself.
Involuntarily, as always, I paused on entering, so breathtaking was the immensity of the place. A single vast circular room, with a diameter of near two thousand feet, it covered almost all the mighty tower's first floor. From the edge of the great circle the room's floor sloped gently down toward its center, like a vast shallow bowl, and at the center stood the small black platform of the Council Chief. Out from that platform back clear to the great room's towering walls were ranged the countless rows of seats, just filling now with the great Council's thousands of members.
Beings there were among those thousands from every peopled sun in all the Galaxy's hosts, drawn here like myself each to represent his star in this great Council which ruled our universe. Creatures there were utterly weird and alien in appearance, natives of the whirling worlds of the Galaxy's farthest stars—creatures from Aldebaran, turtle-men of the amphibian races of that star; fur-covered and slow-moving beings from the planets of dying Betelgeuse; great octopus-creatures from mighty Vega; invertebrate insect-men from the races of Procyon; strange, dark-winged bat-folk from the weird worlds of Deneb; these, and a thousand others, were gathered in that vast assemblage, forms utterly different from each other physically, but able to mix and understand each other on the common plane of intelligence.

A:

There is a "Federation of the Hub" in the universe James H. Schmitz set many of his short stories.  The society is a large, multi-species civilization that seems to fit your parameters.  The earliest of these stories, I think, was "The Vampirate" in 1952 (later renamed "Blood of Nalakia"), then "Sour Note on Palataya" in 1956, although many of the stories fleshing out the universe were written after 1961.  Both of these stories had characters casually use the phrase "The Hub" to refer to the system they were set in, no formal name is given in story.
"Lion Loose" (1961) uses the full name, the Federation of the Hub, in the very first sentence.

For twelve years, at a point where three major shipping routes of the Federation of the Hub crossed within a few hours' flight of one another, the Seventh Star Hotel had floated in space, a great golden sphere, gleaming softly in the void through its translucent shells of battle plastic.

I thought of this series for a couple reasons - one is that while the Federation and its system were well developed over the entire body of stories, many of the stories stand on their own - with the federation as as background, mentioned casually by characters.  This connected in my brain with the 1965 printing of the interstellar patrol short stories, as mentioned in user14111's answer.  Different authors writing short stories in similar venues at the same time, with different federations as backdrop, would probably encourage the federation-as-a-trope a great deal.  [The other reason was I misread the 1965 date as the printing, not reprint, of the interstellar patrol series until I had already written most of my answer...oops.]

A:

There is an Anglo-Saxon Federation according to the Encyclopedia of Science Fiction dating from 1900.
This was created by Robert W Cole with the title of The Struggle for Empire: A Story of the Year 2236.

"The Anglo-Saxon Federation – ostensibly a Utopia with London as its "superb capital" but in truth a class-ridden Dystopia where the rich in their insatiate greed have plundered the planet (see Ecology) – expands ominously into other solar systems in search of raw material to exploit. At this point interstellar warfare breaks out between Earth and a superior race from the Sirius system."
The descriptions of space battles, and of an Earth surrounded by a barrage of space torpedoes and mines while scientists struggle to perfect the ultimate Weapon, make it – as Everett F Bleiler argues in Science-Fiction: The Early Years (1990) – the precursor to and equal of many of the Space-Opera stories of the 1930s.

