The thing is it makes sense for most of the established MCU heroes (before Spider-Man) to have somewhat public identities.
Tony revealed himself because he's an overconfident egomaniac and a control freak who wanted everyone to know how much of a cool guy he is, and he was already a public persona beforehand. His villains also want to fuck with Tony, not Iron Man, anyway, so why bother with the bodyguard shit?
Steve was a propaganda figure, of course people know who he is.
Banner's identity was known to Ross to begin with.
Thor doesn't give a fuck because he's fucking Thor. It's not like the Donald Blak shit has been relevant during your lifetime either.
Hawkeye and Widow were basically treated as government agents in universe, even though SHIELD's status is sketchy the authorities definitely know Clint and Nat.
War Machine is literally an US air force soldier. Falcon is... I don't remember but military. WS was considered a public threat and his identity was secret until Steve revealed it and went "B-Bucky uguuu". Black Panther is literally the title of the ruler of Wakanda. If Wakanda is public, so is he. Vision doesn't have a real identity.
Wanda I'd agree is dumb, she was a criminal and should have hidden her identity, hubris I guess.
Ant-Man's identity was not public until Civil War when he got imprisonned.
Strange never had a codename in comics.
Guardians are criminals who are bad at their jobs.
And, well, Spider-Man's identity is still not public, and has some clear separation between what happens in his life as a hero and as Peter. As in he doesn't just say "I'm actually Spider-Man, don't worry about it" when he can't make it to the decathlon or whatever the fuck that was.