This question has several levels, so i'm just going to look at two: the practical aspect, and the legal aspect.
There were two really well done videos from Nerdsync concerning these topics, so instead of reinventing the wheel, I'll just link them here. The first was concerning the practical issue. As you pointed out, secret identities are "sensitive information", so they are often kept very close to the chest by most heroes. In truth, this was part of what the whole Civil War issue was about; registering heroes to make them accountable for damages and problems which arise from their actions. While good in theory, the practical issue is that for many heroes, working behind a mask allows them to protect their civilian life, and not be subject to the influence of those with a possible negative agenda. There are other reasons for it, but those are the two biggest discussed:
It's my educated guess that in dealing with the "fictional" comics of the Marvel-in house publishing company, this is taken into account; it is either put out with a disclaimer, citing "these events are fictional, and any resemblance to the actual living heroes are not meant to be reflective of their actual deeds" or something similar. Or, in the case of "public heroes" [the Fantastic 4, for instance] they may be given "final say" for the use of their images and stories, meaning they get approval before any books go out.
Thinking about it, this would be both a benefit and a hassle to some heroes; whereas the 4 and the Avengers could "licence" their images and make a profit, I doubt Spiderman was ever properly compensated for his images in use. This is supposition on my part based on the fact that Peter always had cash issues before Parker Industries became a thing, but if anyone has any canonical proof otherwise, please feel free to share.
This then brings us seamlessly to the legal issues, which would be abundant all things considered. Nerdsynch had a video on that as well, but dealing only with one core aspect: the legality of superheroes testifying in court. Apparently, the DC universe has a law that actually allows for costumed heroes to testify in given conditions, as well as to protect their identities if they are being suspected of a crime. the Marvel 616 Universe has a device that can allow Avengers toi be identified in court without their identities being made public knowledge, because the IDs are kept in a federal database. More details about that can be seen here:
I'm not a legal expert, so I don't know how binding this is, but if its "on the books" in the 616 universe, it shows a level of thought that went into that world's powers that be putting things in place because of the "reality" of super beings. So it does make sense.