Cook the spaghetti according to the package directions; drain and return it to the pot.
Meanwhile, heat the oil in a large skillet over high heat. Add the beef, onion, chili powder, and ¾ teaspoon salt. Cook, stirring often, until browned, 6 to 8 minutes.
Add the corn and tomatoes (and their juices). Cook, stirring, until heated through, 2 to 4 minutes.
Add the sauce to the pasta and toss to combine.
Serve topped with the avocado, cilantro, Cotija, and lime wedges.