Mr. Trump questioned how the US “had $40 billion to go to Ukraine” but cannot secure school security at a pro-gun conference.
The intervention comes only days after 21 people were killed in a school massacre in Texas.
“Before we nation-build the rest of the globe, we should establish safe schools for our own children in our own country,” Trump said in his speech on Friday, earning cheers.
The US Congress overwhelmingly approved over $40 billion (£31 billion) in military aid to Ukraine earlier last month. In total, US lawmakers have sent about $54bn to Ukraine since Russia invaded in February.
“Congress should vote immediately to take back every penny of unused Covid relief money,” Mr. Trump went on. “Take it back from the states and use that money to quickly establish impenetrable security at every school all across our land.”
Mr. Trump rejected calls for tightened gun controls, saying decent Americans should be allowed firearms to defend themselves against “evil”.
He instead proposed a “top-to-bottom overhaul” of school safety, with fortified single points of entry including metal detectors and at least one armed police officer on every campus. He accused Democrats of stonewalling such security measures.
The former Republican president began his speech by reading out the names of the Uvalde shooting victims, with each marked by a bell toll.
The annual conference of the NRA, which has five million members, is taking place 280 miles (450 km) from Uvalde, the scene of the worst school shooting in the US in a decade.
Ahead of the event, several conservative speakers and musical performers announced they were backing out including Senator John Cornyn and the manufacturer of the rifle used in the Uvalde attack.
Mr. Trump hit out at those who withdrew, telling the crowd: “Unlike some, I didn’t disappoint you by not showing up.”
Texas Governor Greg Abbott, who had been slated to speak in person at the event, instead told the crowd via video link that gun laws are ineffective at preventing mass shootings.
“There are thousands of laws on the books across the country that limit the owning or using of firearms – laws that have not stopped madmen from carrying out evil acts on innocent people and peaceful communities,” Mr. Abbott said.
“In Uvalde, the gunman committed a felony under Texas law before he even pulled the trigger. It is a felony to possess a firearm on school premises. But that did not stop him.”
Mr. Trump called in his speech for the US to “drastically change our approach to mental health”.
He made a similar call during his presidency, even while critics at the time accused him of trying to defund medical programmes that included mental healthcare.
Before Mr. Trump spoke, Texas Senator Ted Cruz blamed mass shootings mainly on absent fathers, declining church attendance, social media and video games.
Outside the venue, hundred of protesters gathered to oppose the NRA. They held signs saying “NRA kill kids”, “protect children not guns” and held crosses and photos of shooting victims.