Unoptimal AI blocking

I was playing against an AI the other day, and it attempted to block my attack, but it blocked a creature that would have dealt significantly lower damage. It had no chance of killing either, just block some of the damage: why would it not pick to block as much damage as possible?