Tony Stark doesn't react well to authority.
That isn't overly surprising given his massive unresolved issues with his father (not that he'd admit to those issues) and the fact that Obadiah Stane, the other father figure in his life, put out a contract on him and when that failed tried to kill Tony himself.
But there is also the fact that people in authority never actually seem to want Tony. They want Tony's genius, his skills and his money. The fact that Tony might have his own ideas and opinions never seems to enter their minds. And Tony hates that. Because usually he's halfway to a solution by the time they've realized there's a problem.
So when S.H.I.E.L.D. calls him in to deal with the Loki/tesseract problem he's already on edge. And getting confronted with Captain Steven Rogers, a.k.a. Captain America, a.k.a. Howard Stark's paragon of virtue, it was pretty much inevitable that things were not going to end well. Captain America is the exact opposite of Tony Stark. He was the perfect soldier compared to Tony's inability to play well with others. They were bound to rub each other the wrong way, especially since everyone seemed to assume that Rogers should be the leader of Fury's super secret boy band despite the fact that the guy had just woken up from being frozen for seven decades.
Of course the influence of Loki's staff didn't help.
The fact that out of all the Avengers Tony was the first one to decide to follow Captain America was not only ironic but also essentially a miracle. But Tony was also the first to actually fight alongside Steve Rogers. Not in Stuttgart, where Tony largely came in and stole the show, or when Thor showed up, where Cap tried to be the only adult in the room, but instead when Tony and Steve worked to get the Hellicarrier's engine back on line.
Rather than try to take charge Cap had relied on Tony to determine their plan of attack. While he wasn't afraid to tell Tony to 'speak English' or make sure Tony wasn't likely to get shredded while giving the engine a push start, Steve trusted that Tony knew what he was doing and did everything possible to make sure Tony was able to do what needed to get done. Including knocking a grenade out of the air and braving gun fire in order to pull the red lever.
Rather than treat Tony like an underling who needed to do what he was told Cap treated him as a teammate with his own ideas and skills to contribute. And Tony decided that maybe, just maybe, he was okay with following Captain America.
Even if the guy was wearing spangly glorified tights.
