It seems pretty clear to me: out of humanitarian compassion, the Enterprise would repair the malfunctioning ship - not giving them access to any technologies they didn't possess, but making the technologies they DID possess work properly, so that the crew didn't die in space and the ostensibly critical cargo could be delivered.
Revealing that the supposedly critical medical treatment was merely an addictive drug would be making a judgment call as to what sorts of societies the aliens should have, essentially imposing the Federation's opinions as to what appropriate behavior for them should be. But remaining silent and letting one world predate on another in the guise of medical care is abhorrent - thus the central conflict.
The problem is resolved by realizing that they're not obligated to help repair the ships necessary to deliver the drugs from one world to another, and refuse to do so on the grounds that this action would also be interference - a stance that appears heartless and cruel to the suffering planet, which will likely develop a different opinion once they realize what's really been going on.
It's a nuanced and sophisticated quandary with an elegant solution.