It was a means to an end, but not an evil means in itself, and it clearly gave a depressed and lonely man a great deal of pleasure. His indulgence in recreational drugs does not affect his ability to run, and run successfully, a reliable and widespread smuggling operation. In short, it has no ill effects on his ability to function. It's also clear that Han still knows a fair bit about the spice trade and its major movers and shakers - in a novel set nearly 20 years after he's supposed to have left the game. He's had plenty of time to take down the criminals if he had a mind to, or the Republic wanted him to, but we all know that Han's involvement with his old friends is to regularly go drinking with them rather than threaten them with imprisonment.
People take it, and mostly they enjoy a bit of harmless mood enhancement.
Welcome, science fiction, to the real world. We have to go to the Rogue Squadron novels for the only outright condemnation of the spice trade. Corran Horn, perhaps the most clean cut of the recurring Star Wars characters and a former security officer, is the exception to the rule, the one man who condemns Han Solo's past. Even Corran, though, is capable of putting things in perspective. Sometimes people get drunk, sometimes they take drugs, but as long as they don't let their enjoyment interfere in activities and places where it doesn't belong, there's no real problem.