Fill a large pot with several inches of water, add a large pinch of salt, and bring to a boil.
Put the rice in a small saucepan with 2 cups water and a pinch of salt and bring to a boil. Reduce the heat so it bubbles gently but steadily; cover and cook, undisturbed, until the rice is tender and the water is absorbed, 15 to 20 minutes.
Peel the ginger; stem the chile and remove the seeds if you want less heat. Mince the garlic, ginger, and chile. Cut the tofu into 1/2-inch cubes. Rinse and drain the spinach. Fill a large bowl with ice water.
When the water boils, plunge the spinach into the pot for 20 seconds, stirring once or twice. Transfer it to the ice bath with a slotted spoon. When the spinach is cool, drain it into a colander, squeeze it dry with your hands, and chop it.
Pour the water out of the large pot and put it over medium heat. When it’s dry, add the oil and flour, sprinkle with salt and pepper, and cook, stirring frequently and lowering the heat if necessary to keep it from scorching, until the flour darkens a bit and becomes fragrant, about 5 to 10 minutes. Open the coconut milk. Add the garlic, ginger, and chile and cook until they’re fragrant, about 30 seconds. Add in the curry powder and garam masala, whisk in the coconut milk, and raise the heat a bit. Cook, stirring frequently, until the milk is heated through and has thickened a little, a couple minutes.
Fold in the spinach to coat with the coconut mixture. Nestle the tofu cubes in the spinach, cover, and cook until the tofu is warmed through, 3 to 5 minutes. Fluff the rice with a fork; taste and adjust the seasoning of both the spinach mixture and the rice, and serve together.