Heat olive oil in a large pot over medium heat. Add diced onion, garlic, and green bell pepper. Sauté for 3-4 minutes until softened.
Stir in the black beans, diced tomatoes with chilies, and taco seasoning. Mix well.
Add the spaghetti to the pot and pour in 3½ cups of water, ensuring the pasta is submerged.
Bring to a boil, cover, and reduce heat to medium-low. Simmer for 10 minutes, then uncover and stir. Continue cooking uncovered for another 5-8 minutes, stirring occasionally, until the spaghetti is tender and most of the liquid is absorbed.
Turn off the heat and stir in the shredded cheddar cheese and sour cream until melted and creamy.
Serve hot, garnished with chopped green onions.