The Spearfighter Barracks is the first military building in the game, which trains the very first light units - Spearfighter. It is required that the player to have researched the Spears technology before able to build it.
Researching the Spears technology and building a Spearfighter Barracks is part of the tutorial. The Spearfighter is most effective against fast units. It also has an additional defense when standing above tiles with bushes and forests.