The danger of expectation is that action calling itself gratitude with expectancy is not free. You may have read that gratitude manifests abundance, and this is truthful. But if you are acting with a motivation that is merely for personal gain, it is not gracious. Personal gain is a benefit, not the goal. The purpose of gratitude is the giving of agapé. The giving of agapé creates the receiving of agapé and is the ultimate purpose of life.
Satan was an antagonist, testing Job to determine his motivation for righteousness. Was he living righteously for material or personal gain? If he was, upon removal of the benefits God had bestowed, Satan expected Job would curse God rather than appreciate Him. Satan was wrong about Job; though Job cursed himself in his despair, his gratitude towards God did not waiver.
Job's wife was like the friends who encourage kicking your MLCer to the curb because you deserve better or shouldn't put up with his bad behavior and mistreatment. Job's wife wants him to curse God, but to do that would go against what he believes and thus he refuses. Sitting in ashes, his body covered in boils, Job is confused and miserable, but he is not a man who turns away from God, rather his appreciation is consistent.
Our culture has a view that when a person leaves his spouse, there must be a justifiable cause--blame for deeds done or left undone by his wife. He left, what did you do wrong? Job suffered because of his righteousness, not in spite of it. But in the circumstances of spousal abandonment we lack the benefit of understanding motive. As readers, we know that Job's suffering was because though he failed, Satan wanted to prove a point. I can't tell you why your spouse left other than it is not personal. But I can show you the journey of MLC and introduce you to the joys of your own journey; though it may include suffering, it can lead you to bliss. Death took away Job's entire family. They were not reborn and yet his riches were restored and he started a new family. Your marriage is dead; unlike Job's God may restore it someday or like Job you may find someone new. Either path has beauty. Gratitude is a recognition of the beauty in all things.