This is about as close as the season came to matching "The Trouble with Tribbles" for sheer enjoyment factor. Like "Trouble," "A Piece of the Action" has endured as a classic, and rightfully so.
Perhaps too often, the series dipped into the well of story types that would have been familiar to audiences at the time. Hence, the gangster episode. It makes no sense otherwise, a civilization somehow corrupted by exposure to a book (that...probably wouldn't really happen, unless we're talking about a completely different kind of book), but once you accept the gimmick for what it is, it becomes one of the more distinctive versions of the kind of story the series tried to tell on multiple occasions: a contaminated culture that Kirk has to try and clean up.
It's also a Prime Directive episode, not in the sense that it's Kirk bending the rules (this time), but the result of our own people having screwed up in the past (reasonable speculation has it as being the crew of the Horizon as featured in Enterprise, as featured in the episode "Horizon").
Like "Trouble," it features Kirk being able to let loose a little. He determines that the best way to approach the problem is to assimilate into the culture so as to not further expose the natives to things they shouldn't know about (such as Starfleet). This is fun to watch, classic Kirk all around. Again, completely ludicrous, but in a good way. One gets the sense that if Kirk had it his way, this is what he'd be doing all the time. James Bond, in a sense, by way of Jacques Clousseau.
Ironically, the end of the episode features another contamination, McCoy leaving his communicator behind (which becomes the inspiration for another Enterprise episode, "The Communicator;" it's not your imagination, that series titled its episodes pretty literally).
Next Generation brought gangsters back to the franchise thanks to Picard's obsession with Dixon Hill. But that was done on the holodeck.
four quarter analysis
franchise * series * essential * character