The state doesn't punish evil thoughts mainly because, aside from problems of proof, a thought alone causes no harm to another.  But God is not the State.   It is offensive to God for you to willfully harbor thoughts of killing someone, or of committing adultery with another's spouse (Thou shalt not covet . . .), or to be envious, or  . . . well, you get the point.  Fantasy can indeed be sinful, and comparing a willfully entertained fantasy to a dream doesn't work, for obvious reasons.  You sound new to Catholicism.  Let me recommend getting your hands on a good book on Catholic moral theology.  You'll enjoy the things it will reveal to you, and chances are good it will bring you closer to God.  God bless.