Are we not supposed to even talk about immoral things?

Q.  Paul says in Ephesians, “Have nothing to do with the fruitless deeds of darkness, but rather expose them. It is shameful even to mention what the disobedient do in secret. But everything exposed by the light becomes visible—and everything that is illuminated becomes a light.” I’m confused. Does this mean we’re to mention/expose bad things, or not? Or is he saying both? Like, gossip is bad but whistle-blowing is sometimes necessary?

In this section of Ephesians, Paul is offering practical teaching about what it means to “put off the old self” and “put on the new self” as a follower of Jesus.

The specific part of this teaching that you’re asking about takes up the topic of how believers talk among themselves and what kinds of actions this talk inevitably leads to.  Paul says that “sexual immorality and all impurity or covetousness must not even be named among you, as is proper among saints. Let there be no filthiness nor foolish talk nor crude joking, which are out of place, but instead let there be thanksgiving” (ESV).

One thing we see here is that “the ‘putting off’ of a destructive behavior is actually accomplished through the ‘putting on’ of a life-giving one that displaces it,” as I note in my study guide to Paul’s Prison Letters.  “Filthiness” and “foolish talk” and “crude joking” are replaced by thanksgiving, “a positive appreciation for what is excellent and praiseworthy in any situation.”

But another thing we see is that immorality and impurity have two ways of getting a hold over us.  This can happen if we glamorize them as the subjects of supposedly entertaining jokes or stories.  But it can also happen if we give them an alluring cachet as secretive and exclusive practices that only the initiated are in on.  In other words, we can give these things unwarranted power in our lives if we talk about them too much or in the wrong ways, or if we don’t talk about them enough, in a cautionary way.

Paul is saying, in other words, that in our conversations as followers of Jesus, we need to walk a fine line.  We need to acknowledge and expose the “works of darkness” so that they cannot continue under the cloak of secrecy and draw in unsuspecting people by the allure of their supposed exclusivity.  But we need to do this in a way that doesn’t sensationalize or glamorize these activities, or that will end up promoting them.  Whistleblowing without gossiping, to use your terms.

This is why there seems to be a tension in Paul’s words here between speaking and not speaking about these “works of darkness.”

(Incidentally, I would translate the end of the statement you quoted in your question this way:  “Everything exposed by the light becomes visible, because everything that is visible stands in the light.”  The Greek says literally that it “is light,” but the meaning is that it “is lighted.”)