In the same way that you don't get to be a principal engineer at Google on your first day out of college, you don't get to be a captain on your first day out of flight school.
But the pay and working conditions for new pilots is rather worse than it is for new programmers.