There are at least two quite different crimes both involving securing personal gain from other people's secrets. One is a subtype of extortion, where one makes money by promising not to reveal someone else's secret. The other is insider trading, where one makes money by acting on someone else's secret before it is revealed.
Secrets that are the subject of extortion threats are frequently not a crime or even a civil wrong giving rise to liability to publicly disclose. And, revealing a secret from an insider that materially affects the value of its stock to the general public before trading on it is likewise often neither a crime nor a civil wrong. Indeed, in both cases, revealing the secret is often considered a public service and is constitutionally protected. If the person who receives the secret does not act improperly in obtaining it, that person is generally free to disclose it, and even when a secret is obtained illegally, the punishment for the crime is often unrelated to the disclosure or non-disclosure of the secret and is frequently a misdemeanor.
It also isn't necessarily a crime or even civil wrong to profit from revealing someone else's secrets. While it would be a crime to extort cash not to publish information that someone had an affair, making money by selling that story to a gossip magazine or working as a private investigator using only legal means is perfectly legitimate. While trading securities on insider information is illegal, revealing negative inside information about a company in order to get a superior fired so that you can have a shot at that job when the vacancy arises. So it revealing negative insider information about a company so that stock in a competitor of a company becomes more valuable, so long as you already owned the competitor's stock it when you learned the inside information.
Nor is it a profit to keep other people's secrets, even for profit. Lawyers, doctors, mental health professionals, priests, accountants and many government employees are legally required to keep other people's secrets and are paid to do so. However, in those cases, the secrecy is promised in exchange for trust from someone who needs to know the information for reasons that often benefit the person who is the source of the secret, and the profit generally is from the secret's source or from someone who is financially indifferent to whether or not the secret is revealed.
In contrast, extortion and insider trading involve either harm or threatened harm to the source of the secret from others. In the case of both extortion and insider trading, not revealing the secret may harm the public, either because they are denied important negative reputational information about someone, or because they are inaccurately valuing a security and being exploited by someone else as a result of that inaccurate valuation.