Because generating a sensation and detecting a stimulus are different jobs, done by different tissue.
Pain begins at nociceptors, free nerve endings in skin, muscle, joints and viscera. The brain parenchyma has none. So there is nothing there to fire when it is cut, and no signal to interpret.
The brain is the interpreter, not the sensor. Asking why it does not hurt when cut is a bit like asking why a camera lens does not appear in its own photographs.
Worth adding that the skull, scalp, and especially the meninges are richly innervated. That is why awake craniotomy still needs local anaesthetic to open the head, and why meningitis hurts so much.