Cook spaghetti according to package instructions until al dente.
Drain and set aside.
In a large skillet, sauté onions and bell peppers over medium heat until soft.
Add diced tomatoes, black beans, and corn to the skillet.
Season with chili powder, cumin, salt, and pepper.
Stir the mixture and let it simmer for about 5 minutes.
Add the cooked spaghetti to the skillet.
Toss everything together until the spaghetti is well coated.
Cook for an additional 2-3 minutes to heat through.
Garnish with fresh cilantro before serving.