Heat olive oil in a large pot over medium heat.
Add the diced onion and sauté for about 3-4 minutes until it becomes translucent.
Stir in the minced garlic, carrots, celery, and red bell pepper. Sauté for another 5 minutes until the vegetables soften.
Add the drained diced tomatoes, vegetable broth, kidney beans, and corn to the pot. Stir to combine.
Season the soup with oregano, basil, salt, black pepper, and red pepper flakes if using. Bring to a boil.
Once boiling, reduce the heat and let the soup simmer for about 20 minutes.
Add the fresh spinach in the last 5 minutes of cooking, stirring until wilted.
Taste and adjust seasoning as needed.
Serve hot, ladled into bowls.