Palmer Luckey, founder of Oculus and a new defense startup, told CNBC on Friday that Alphabet's Google should have renewed its contract with the Department of Defense.

"I think they were making a mistake" in letting the contract expire, said Luckey, a supporter of Donald Trump in the 2016 presidential election. "It's really important that the United States maintains a technological leadership. It's important that our military retains a technological leadership."

Google's government contract, which focused on artificial intelligence, expired earlier this year. But the tech giant has faced backlash in the past week for its continued AI work in Shanghai after billionaire tech investor and Trump supporter Peter Thiel called the company treasonous.

Google did not immediately respond to a request for comment.

Luckey sold his Oculus virtual reality headset company to Facebook for $2 billion in 2014, and left there in March 2017 under controversy. Since then, he's founded Anduril Industries, a defense technology start-up that's focusing on national security and artificial intelligence.

Anduril reportedly supports a government AI drone project, though Luckey declined to comment on it due to confidentiality. He stressed the importance of the U.S. leading technological innovation, later comparing AI to the nuclear weapons race of the past, in a "Squawk on the Street" interview.

"If we had not been the leader, we would not have dictated the rules," Luckey said.

If scientists and researchers across the U.S. refused to work on nuclear weapons due to ethical reasons, like Google did on AI, the world would be much worse, Luckey said.

"Imagine if the Nazis were the first person to make practical nuclear weapons," he said. "Imagine if the Russians were the first people to make practical nuclear weapons. We would be in a very different world today. It would be a lot worse."

On Monday, Joe Lonsdale told CNBC that his fellow Palantir co-founder Thiel was "courageous" for speaking out against Google, which "is not a patriotic company."

Data analytics miner Palantir has worked with many agencies of the U.S. government, including the Defense Department, CIA and FBI.

Lonsdale called Palantir "probably the most patriotic in the Valley."