While this isn't really clearly spelled out, we do see that there's a bit of hero worship, a bit of distrust of Stark, and maybe a little bit of rogueish nature peeking through as he shrugs off being on the wrong side of the law again.
Put them all together, and he's joining up with Cap's team.
All quotes from the transcript:
Scott Lang: What timezone is this?
Clint Barton: Come on. Come on.
Scott Lang: [Scott shakes Steve's hand with an amazed look.] Captain America.
Steve Rogers: Mr. Lang.
Scott Lang: It's an honour. I'm shaking your hand too long. Wow! This is awesome! Captain America. [He looks at Wanda.] I know you, too. You're great! [He turns back and feels Steve's shoulders.] Jeez. Ah, look, I wanna say, I know you know a lot of super people, so... Thinks for thanking of me. [To Sam.] Hey, man!
Sam Wilson: What's up, Tic Tac?
Scott Lang: Uh, good to see you. Look, what happened last time when I...
Sam Wilson: It was a great audition, but it'll... it'll never happen again.
Steve Rogers: They tell you what we're up against?
Scott Lang: Something about some... psycho-assassins?
Steve Rogers: We're outside the law on this one. So, if you come with us, you're a wanted man.
Scott Lang: Yeah, well, what else is new?
Later on, he muses that he was told to never trust a Stark.
Scott Lang: Hank Pym always said, you never can trust a Stark.
It's also worth noting that Sam Wilson had already been in contact with Scott earlier in the movie, enlisting his help to free Bucky.
That said, I don't really get the feeling that he's got a strong moral allegiance, and may have joined up with Tony had he approached first.