Ashwatthama was cursed by Lord Krishna after Ashwatthama killed all the sons of Pandavas with his Brahmastra.
He was cursed with immortality and eternal (till the end of this chaturyuga) suffering without love from anybody.
Lord Krishna Knows that soul never dies, then why did he curse Ashwatthama.?