We don't know anything about him "helping" Chewie, and he only "helps" Luke and Obi-wan because they offer him seventeen thousand credits, got him stuck in an Imperial space station, and introduced him to a rich princess. He doesn't do anything altruistic until after he gets his reward and leaves. Even that act can be seen as self-serving; he's had run-ins with the Imperial fleet, and blowing up one of their space stations could've been his revenge.