Its because you have unfinished business. I dont mean sexually or anything to do with the relationship because you broke up for good reason. But my ex was still appearing in my dreams 2 years into a new relationship of mine. I emailed my ex and apologised for everything that I felt contributed to the breakup and he replied doing the same. Since then, he hasnt even crossed my mind. It just needs putting to bed.