The joke is a pun.  If you break the tip of a pencil, there is no point on the pencil until it is resharpened.  To say something is 'pointless' means to say that it has no purpose.
To write with a broken pencil is pointless .