Gregory B. Lewis is a professor of Public Management and Policy at Georgia State University.

An important way the U.S. shows its gratitude to veterans who have fought America's wars is by giving them a leg up in getting a job with the federal government.

The policy, known as "veterans' preference," became law after the Civil War, was strengthened following World War I and grew even more entrenched after World War II and in the wake of the wars in Iraq and Afghanistan.

While it's good that the nation thanks its troops, the strong preference for veterans has had some negative effects as well, particularly in terms of lessening the civil service's diversity, as my research into this policy shows.

How Veterans' Preference Works

Congress gave disabled veterans preference in hiring for some federal jobs after the Civil War.

Lawmakers greatly expanded it after World War I, allowing able-bodied, honorably discharged veterans to receive a hiring preference in most civilian federal jobs, as well as widows of deceased veterans and wives of severely disabled ones. More recently, the Obama administration strengthened veterans' preference by directing agencies to establish hiring goals and making other changes.

As a result, one-third of new federal hires are veterans.

Here's how it worked up to 2010: The civil service rated job applicants for almost all nonpolitical jobs on a 100-point scale, typically by having them take a test or evaluating their education and experience. Disabled veterans got an extra 10 points added to that score, while other former soldiers received 5 points.

The federal personnel agency ranked applicants based on this score and, when the final score was a tie, placed veterans ahead of nonveterans. Thus, disabled veterans with scores of 90 and other veterans with scores of 95 ranked higher than nonveterans with scores of 100. In addition, veterans with more serious service-related disabilities "floated" to the top of the list as long as they scored above a passing grade of 70.

Typically, hiring officials had to choose one of the three candidates with the top scores. If the final three included both veterans and nonveterans, the hiring official needed written permission from the federal personnel agency to "pass over" a veteran to hire a nonveteran lower on the list.

That's how the vast majority of current federal employees were hired. Since 2010, hiring officials set bars in advance to divide qualified applicants into two or more levels. They can consider anyone in the most-qualified category.

Veterans no longer get extra points, but they do get placed at the top of whichever category they qualify for, and veterans with compensable disabilities go to the very top if they meet minimum qualifications. Hiring officials cannot pass over veterans in the top category to hire more qualified nonveterans.

The evidence is not all in, but the new system probably strengthens veterans' preference.

The Policy's Impact

This preference dramatically increases one's chances of getting a federal job. Even though veterans have decreased as a share of the federal workforce -- as World War II and Vietnam War veterans have retired -- their odds of getting government jobs have actually increased.

In 1980, census data show that veterans were about twice as likely as nonveterans to hold federal jobs (9% of veterans were federal employees, compared with 4% of Americans without military service). By 2015, the share of veterans working for the feds soared to 18%, while less than 3% of nonveterans held federal jobs -- mostly thanks to the changes initiated during the Obama years. (The percentages are estimates based on a sampling of data from census years.)

The pattern is especially strong among younger veterans, those born since 1980, who are about 15 times as likely as nonveterans of the same age to hold federal jobs. Nearly 10% of veterans born from 1920 to 1950 held federal jobs when they appeared in the census data. That rose to about 15% for those born in the 1950s and 1960s. Veterans born since 1970 are even more likely to be federal employees, and nearly half of those born in 1990 had a federal job by 2015.

Every state also gives veterans some hiring preference for government jobs. Four -- Massachusetts, New Jersey, Pennsylvania and South Dakota -- even provide "absolute" preference, that is they hire veterans with a passing score ahead of all nonveterans. These programs have had much less impact on state government workforces, however, perhaps because veterans have less desire for state than for federal jobs.

How This Affects Diversity

This very strong preference for veterans ends up hurting groups that are less likely to have military service.

Strongly preferring a group that is so male necessarily disadvantages women. Even today, 89% of veterans are men, yet only 53% of nonvets in the workforce are. White men make up 69% of vets but only 37% of nonveterans. And most minority groups apart from black men are underrepresented among veterans, particularly women. White women, for instance, make up only 7% of veterans, even though they make up 3% of the rest of the workforce.

My research finds that the civil service would be more diverse in the absence of veterans' preference, in which case the male-female split in the federal service would be 50-50 rather than its current 57-43 breakdown. And the employment of Latinos, Asians and gay men would probably all increase by 20%.

The Costs of Preferring Vets

Clearly, veterans' preference has had a powerful and growing impact on who gets federal jobs.

Although it directly benefited only about one-tenth of veterans in the past, nearly one-third of recent veterans have federal jobs, many more than would have them in the absence of preferential hiring. This makes it an effective policy to express the nation's thanks for veterans' sacrifices.

Yet all policies come with costs. Applicants without military service pay some of them by having a lower chance to get these jobs, and nonveterans are concentrated among women and, to a lesser extent, Hispanic, Asian and gay men.

The nation loses, in my opinion, from a less diverse federal service.

-- The opinions expressed in this op-ed are those of the author and do not necessarily reflect the views of Military.com. If you would like to submit your own commentary, please send your article to opinions@military.com for consideration.