It is true the better presidents where the ones that did not serve.
I think with a massive standing military organization, which we have effectively had only since the end of WWII, the question needs to focus on that period. Since WWII, that means our "non-service" presidents are Clinton and LBJ (brief, politically motivated "publicity" tour in uniform only doesn't count). Possibly GW Bush, too, since he was never active duty and there remains mystery about his legal and dutiful completion of his guard service. You can classify him where you like.
I do not think they were on average better than Truman, Eisenhower, JFK, Reagan, GHW Bush? I will concede that Nixon was a less successful president than Clinton and LBJ, but his handling of the military was acceptable.
Thus,
I. Active duty officers with honorable service, wartime or not:
Truman
Eisenhower
JFK
Nixon
Ford
Carter
Reagan
GHW Bush
%. "effective" in handling the military or wars - 100% ( Difficult calls and methodology: 1) Truman brought the Korean war to a halt, preserved a non-communist state and did not create a broad war on the Asian mainland; 2) Nixon wrapped up an insoluble mess created by LBJ and overall eased Cold War tensions.)
II.. No service, "vanity" service or questionable service:
Clinton
LBJ
GH Bush
% effective - 33% to 50% (Only Clinton successfully managed military operations in his time - the other two badly mismanaged wars on their watch If we want to count FDR, it gets complicated, because he badly mis-managed the military preparation prior to WWII, but then handled it brilliantly during the war. If we include him, it goes up to 50%).
Conclusion: I prefer some degree of active duty service and experience based on some simple analysis.