It took on the current meaning back around the first Clinton administration. People referred to "policy wonks" at first to mean the people in the administration and NGOs mostly concerned with government policies as opposed to fans that cared more about the people elected. In particular it implies extensive knowledge of all the policy details, which is unusual for politicians.

From there, the adjective "wonky" came into use.