Preheat the oven to 400°. Spray a 9-inch round cake pan, springform pan, or baking dish with nonstick cooking spray.
Heat the oil in a large skillet over medium heat. Add the onion, cumin, chili powder, and garlic and cook until you can smell the spices and the onion is softened, about 3 minutes. Stir in the tomatoes with the ? cup of reserved juice and the tomato paste, then stir in the beans. Season with salt and pepper to taste. Let the bean mixture simmer until everything is hot, about 3 minutes. Add the corn and spinach and stir until the spinach has wilted and everything is well blended and hot, about 3 minutes. Taste for seasoning, adding more salt and/or pepper as necessary.
Place 1 tortilla in the prepared cake pan. Spread one fourth of the bean and vegetable mixture evenly over the tortilla, then sprinkle ½ cup of the shredded cheese evenly over the top. Repeat with 3 more layers, ending with the last quarter of the bean mixture and then the last ½ cup of shredded cheese.
Bake the tortilla casserole until it is hot throughout and the top is lightly browned, about 20 minutes. Let the casserole sit for about 5 minutes, then cut it into wedges. Sprinkle the top with cilantro, if desired, and serve with sour cream and/or salsa on the side, if you like.
Make Ahead
This recipe can be made ahead of time and refrigerated. To reheat, bake in a 350F oven for about 20 minutes.