Why did Satan take everything Job had (his sons, daughters, and all his wealth) but spared his wife? In Job 1:12, 2:6 - the only thing Satan did not have permission to do was to take Job’s life.
In his comment, @Kris gives half the answer. If you look at what his wife says, it lines up perfectly with what Satan was trying to accomplish.
Job 1:11 (Satan) - But stretch out Your hand and strike everything he owns, and he will surely curse You to Your face.
Job 2:5 (Satan) - But stretch out Your hand and strike his flesh and bones, and he will surely curse You to Your face.
Job 2:9 (Wife) - His wife said to him, “Do you still retain your integrity? Curse God and die!”
However, there is more to it than Satan's designs, there is also God's power and sovereignty.
Job 1:9 (Satan) - Satan answered the Lord, “Does Job fear God for nothing? 10 Haven’t You placed a hedge around him, his household, and everything he owns? You have blessed the work of his hands, and his possessions have increased in the land."
Just as God has placed a hedge around Job, he has also placed a hedge around all of us. The hedge may be low for the wicked and high for the righteous, but God decides how much good or ill he will permit to enter our lives.
So Satan persuaded Job's wife to torment Job on his behalf, so he let her keep on living. But that was not the end of the story.
Job 42: 10-15 - 10 After Job had prayed for his friends, the Lord restored his prosperity and doubled his previous possessions. 11 All his brothers, sisters, and former acquaintances came to his house and dined with him in his house. They sympathized with him and comforted him concerning all the adversity the Lord had brought on him. Each one gave him a qesitah[e] and a gold earring.
12 So the Lord blessed the last part of Job’s life more than the first. He owned 14,000 sheep, 6,000 camels, 1,000 yoke of oxen, and 1,000 female donkeys. 13 He also had seven sons and three daughters. 14 He named his first daughter Jemimah, his second Keziah, and his third Keren-happuch. 15 No women as beautiful as Job’s daughters could be found in all the land, and their father granted them an inheritance with their brothers.
Some traditions hold that the wife left Job, or died, and he remarried, possibly taking Dinah as his wife, hence marrying into Jacob's family. But many others believe that Job, after forgiving his friends (as the Lord commanded), also forgave his wife. Thus the new children were from his first wife as well. In that case, God used the wife's hard heart and temporary allegiance to Satan to protect her from harm until He could bless Job again. He used the devil's wiles against him, so that Job could prosper. Without his wife, he could not have more children by the same wife, which situation is the most powerful demonstration of the victory over Satan that could be achieved, short of resurrecting his first children.
First of all, while it appears that Satan took everything Job had, he not only spared Job's wife, but also three of his friends, who appeared by his side to offer comfort and advice. They remain for no other purpose than to serve the narrative. These four characters become mouthpieces for various responses to suffering, setting the stage for Job to challenge their worth in light of his position as a wholly blameless and righteous man who is suffering without cause.
In Genesis, the wife and her husband are considered 'one flesh' although they are of two minds:
That is why a man leaves his father and mother and is united to his wife, and they become one flesh. Genesis 2:24
This distinction between them is often presented in the narrative as the man's spirit - his righteousness and alignment with God's will - alongside the man's flesh - represented by the voice and influence of his wife:
To Adam he said, “Because you listened to your wife and ate fruit from the tree about which I commanded you, ‘You must not eat from it,’ “Cursed is the ground because of you; through painful toil you will eat food from it all the days of your life." Genesis 3:17
So, when Satan takes 'everything' Job had (his sons, daughters and all his wealth), his wife is not mentioned (although she, too, has lost the same). But when Satan attacks Job's flesh, it is his wife who responds directly to the suffering he experiences:
His wife said to him, “Are you still maintaining your integrity? Curse God and die!” Job 2:9
Job, however, is quick to silence the voice of his flesh, rebuking his wife for sounding like a "foolish woman" (the Hebrew word 'foolish' having moral connotations). By not listening to his wife, Job demonstrates his righteousness, while his wife, having served this narrative function, takes no more part in the story.
I believe there would be no definitive answer seen in the scripture but here is my speculation. I believe that Satan spared Job’s wife because Job did not value his wife. There was value in everything that Job lost except the relationship with his wife.
Job was extremely proud and self righteous. Job's pride centered around his impeccable behavior and his physical accomplishments. To illustrate this,in Chapter 29, Job gives us a glimpse into his soul as he remembers back to the good old days when he was a revered member of the community. If you understand the full context of the Book of Job, you will understand that Job’s position in the community was Job’s most prized possession. Job’s words in this chapter indicates his intense pride to the point of loving the adoration to the point of being worshiped as a god (see below).
All Job’s losses (flocks/herds and his children) were all directly related to his status in the community). His wife had no role in his community standing, therefore this relationship was of little value to Job.
Here’s a section of chapter 29.
2 Oh that I were as in months past, as in the days when God preserved me; 3 When his candle shined upon my head, and when by his light I walked through darkness; 4 As I was in the days of my youth, when the secret of God was upon my tabernacle; 5 When the Almighty was yet with me, when my children were about me; 6 When I washed my steps with butter, and the rock poured me out rivers of oil; 7 When I went out to the gate through the city, when I prepared my seat in the street! 8 The young men saw me, and hid themselves: and the aged arose, and stood up. 9 The princes refrained talking, and laid their hand on their mouth. 10 The nobles held their peace, and their tongue cleaved to the roof of their mouth. 11 When the ear heard me, then it blessed me; and when the eye saw me, it gave witness to me: 12 Because I delivered the poor that cried, and the fatherless, and him that had none to help him. 13 The blessing of him that was ready to perish came upon me: and I caused the widow's heart to sing for joy. 14 I put on righteousness, and it clothed me: my judgment was as a robe and a diadem. 15 I was eyes to the blind, and feet was I to the lame. 16 I was a father to the poor: and the cause which I knew not I searched out. 17 And I brake the jaws of the wicked, and plucked the spoil out of his teeth. 18 Then I said, I shall die in my nest, and I shall multiply my days as the sand. 19 My root was spread out by the waters, and the dew lay all night upon my branch. 20 My glory was fresh in me, and my bow was renewed in my hand. 21 Unto me men gave ear, and waited, and kept silence at my counsel. 22 After my words they spake not again; and my speech dropped upon them. 23 And they waited for me as for the rain; and they opened their mouth wide as for the latter rain. 24 If I laughed on them, they believed it not; and the light of my countenance they cast not down. 25 I chose out their way, and sat chief, and dwelt as a king in the army, as one that comforteth the mourners.