unmet expectations

I would like to ask you about expectations. It seems like our brain has a natural tendency to set them. If my expectations are not met, I tend to argue with reality and feel disappointed or resentful. It is as if because I expected something, I earned some credit to see it happen. At the same time when we set goals with ourselves aren’t we creating expectations? Are they functional or we had better drop them?