Every time someone has played Akiro's Hammer against me, my response has been, oh good, I win. Now, in most of those games I was playing an aggressive or midrange build that weren't particularly reliant on conjurations. It would be better in theory against some of the spawnpoint builds I'm working on now, but it's still inefficient enough and slow enough that I wouldn't be very concerned even if I didn't have a wall to neuter it and I was playing a conjuration reliant strategy.
Barracks is very slow to get going. Much slower than other spawnpoints, and it's the least tough for it's cost spawnpoint I can think of. Whenever someone has played the Barracks against me, I've either killed it or the Warlord before it accomplished much. It may work better with Meditation Amulet, but I'd be surprised if that worked very well. I'd much rather use Meditation Amulet with a Lair or something.
The other issue with the strategy you describe is that it's vulnerable to strong position control. Iron Golems and Wall of Pikes in particular are vulnerable to position control. Whenever a Warlord plays a Wall of Pikes against me, I end up putting him on the wrong side of the Wall of Pikes, which often forces him to flee through his own Wall of Pikes. Wall of Pikes influences positioning, but most Warlord's don't have the position control for it to work out sufficiently in their favor to justify in my experience.
It sounds like you didn't pressure the Warlord early, and you didn't build a strong enough economy to win the late game. Either should work, although rushing will pretty much auto win against a turn 1 Akiro's Hammer. Also, as noted above, the Barracks can't summon Iron Golems.