The joke is a pun on the word 'lame'.  Lame can mean 'uncool' or not good enough.  'Lame' is also used to refer to a horse or other animal that has a broken or damaged leg and cannot walk normally.  The student was limping, so one could say they are lame.
A student limped into class with a lame excuse .