There are different kinds of kidney stones that can occur in different urine environments in the kidney.
The concern with spinach, as noted in previous posts, is the risk of having too much oxalic acid in the blood that combines with calcium being excreted by the kidneys in the urine. If these two ingredients are concentrated in the urine at the kidney, and are not flushed through with enough water, then crystals of calcium oxalate can form and these crystals can combine to form a stone.
Cooking spinach can reduce the amount of oxalate taken into the body and ingested.
Combining the spinach with a calcium rich dairy food such as cheeses will reduce the amount of oxalate absorbed as the calcium binds the oxalate in the intestinal tract rather than allowing it to be absorbed into the blood stream.
Maintaining good hydration with water to prevent the urine from becoming concentrated is an underlying step to prevent calcium oxalate kidney stones.
There are other kidney stones that can occur. Uric acid kidney stones, for example, can occur in insulin resistant people. It is another related topic.