Here's why:
* Iron Man 3 focused on Tony Stark's personal struggles and the aftermath of the events in The Avengers. Black Widow's role in the larger Marvel Cinematic Universe was more prominent in other films like Captain America: The Winter Soldier and Avengers: Age of Ultron.
* Black Widow's own solo film was released in 2021, focusing on her past and independent journey.
So, while Scarlett Johansson was a key part of the Avengers team, her presence wasn't necessary for the plot of Iron Man 3.