By Jennifer Hansler CNN

(CNN) -- Former Secretary of the Navy Ray Mabus decried President Donald Trump's efforts to prevent transgender individuals from serving in the military.

"This notion that all of this work's been done and these people felt safe as transgender, felt safe coming out, joining the military, and then suddenly the rug gets jerked out from under -- it's not the way to treat patriots, it's not the way to build a great military force either," Mabus said on "The Axe Files," a podcast from the University of Chicago Institute of Politics and CNN.

Story Continues Below

Mabus, who served as head of the Navy under President Barack Obama from 2009 to 2017, lamented that the Pentagon "didn't move fast enough" in instituting a policy to allow transgender individuals to openly serve in the military.

"We could have solved that under President Obama but it wasn't done and it was left for the next administration," Mabus explained.

That policy was still under review in July 2017 when Trump announced in a series of tweets that he would reinstate the ban on transgender troops. Mabus suggested the move was done "out of prejudice and bias and to rile up (his) base."

Trump signed a formal directive in August 2017 to ban transgender recruits and prevent the Department of Defense from using its resources to provide medical treatments regimens for those currently serving. The directive was blocked by two federal judges later that year. In March 2018, the White House announced it rescinded its earlier policy and instituted a new policy to ban most transgender individuals from serving following a Pentagon policy review.

Story Continues Below

Mabus, who pushed for increased diversity during his tenure as Navy secretary, expressed concern about a potential backslide under the Trump administration.

"The way I approached it was you set standards, job-specific standards. Once you've done that, then gender and race and sexual orientation ... doesn't matter the only qualification to get a job ought to be the ability to do the job," he said. "A more diverse force is a stronger force."

Mabus said he "pushed very hard" for the repeal of the "Don't Ask, Don't Tell" policy, which he described "one of the dumbest laws you can possibly have or have had."

In discussing its repeal, Mabus recalled the moment he was approached Navy medic who had just finished his third tour of duty with the Marines.

"He said, 'I've been in for 11 years and I'm gay,' and he said 'My biggest fear was that I was going to be found out and kicked out.' Now here's a person, three combat tours and yet his biggest fear was he was going to be kicked out," Mabus said. "How much weaker does that make us? How much worse a force does that make us?"

"We were asking people to lie about who they were, what they were about. And it's just, from every standpoint, it's wrong and it's dumb militarily," he said.

TM & © 2018 Cable News Network, Inc., a Time Warner Company. All rights reserved.