The loss of sensation on the opposite side of the lesion is because the nerve fibers of the spinothalamic tract (which carry information about pain and temperature) crossover once they meet the spinal cord from the peripheries.
The loss of sensation on the contralateral side of the lesion occurs because the sensory nerve fibers of the spinothalamic pathway cross over at the level of the spinal cord before entering it from the periphery.