Prepare all ingredients by dicing onions, mincing garlic, halving cherry tomatoes, and chopping basil if using.
In a large pot over medium heat, warm olive oil. Sauté onions until soft and translucent (about 5-7 minutes). Add minced garlic and cook for an additional minute.
Stir in the tomato paste and cook for another couple of minutes.
Add halved cherry tomatoes, canned diced tomatoes with their juice, dried oregano, red pepper flakes (if using), salt, black pepper, chicken stock, and penne pasta. Stir well to combine.
Bring the mixture to a boil then reduce heat to medium-low; cover and simmer for about 10 minutes.
Remove lid and continue cooking for another 8-12 minutes until pasta is al dente.
Gently fold in fresh spinach until wilted.
Remove from heat; stir in cheese if desired. Serve hot.