The second part of your question essentially answers the first. Age should be taken into account precisely because the punishment should fit the crime.
In our system, the seriousness of a crime is measured not simply by what is done, but also by the intent and the mindset of the person who acts. We can see this, for example, in the difference between first degree murder and manslaughter. The greater the intent, the more serious the crime.
We believe that younger people cannot have the same sort of intent that older people do. We believe that young children lack the sorts of impulse control that older people have. Therefore, younger people have a lower degree of intent for any given action. A 12 year-old who steals, then, is held to be less culpable for their actions than a 22 year-old who does the same.
For this reason, giving equal punishment to children and to adults would not be "making the punishment fit the crime."