The AFL did not punish them specifically for doping offences because it would hurt their bottom line. This is reflected quite heavily in their press conference, which seems rather apologetic for Essendon. In fact, you'll notice they go to bat in for them a few times there. If it weren't for WADA, the AFL would have swept it under the carpet. "Within the AFL's framework", what a load of tosh. They had the power to nail them for doping offences but chose not to.
You talk about past mistakes but what Essendon did to this sport was far more damaging and longer-reaching than any salary cap shenanigans, with the possibility of negative health effects down the track. They got off lightly because the AFL did not have the balls to do what was right, fearing it would result in a loss of profit. And let's be frank here, Essendon were never going to fold, even with harsher penalties - so they deserved a bigger whack for treating their own players as guinea pigs. If it's going to keep them on the bottom for ten years - what does it matter? Shouldn't have orchestrated a doping regime in the first place.
And adding the final insult to injury the AFL actually rewarded Essendon with the number 1 draft pick when their players finally served their penalties.
Pretty much like letting the fox eat the chickens once he's been caught in the chook house.