It looked to me like Aokiji opened a hole in his chest to allow the spear to pass through, to avoid the blow. Otherwise, I have not idea why he wouldn't have gotten stabbed.