Why is 汉子 measured in 条?
First, your are correct that 汉子 is more commonly being refer to as a man / manhood. And 条 is quantifier for refering things that are long, straight. So go figure =P.

However, 条 is not derogatory. We also use 条 for a life e.g. 一条人命, or a river 一条河, or loyalty 一条心. So it very much depends on the context.