The NSW Court of Appeal upheld the federal intervention which enabled the re-endorsement of ministers Alex Hawke and Sussan Ley, along with backbencher Trent Zimmerman.
The matter was found by the court to be not judiciable.
The decision means the candidates in the three NSW seats can contest their electorates.
The judgment has cleared one of the final hurdles for the prime minister, who is set to call the federal election in a matter of days.
Australians are set to go to the polls on May 14 or May 21.
Government frontbencher Jane Hume welcomed the court's decision ahead of the election.
"It's an excellent outcome, and we now get our candidates on the ground and get under way," she told reporters in Canberra on Tuesday.
Internal ructions in the NSW Liberals have led to a week of attacks on Mr Morrison's character from senior figures from within his own party.
NSW Liberal senator Concetta Fierravanti-Wells criticised the prime minister's character and trustworthiness in a budget night attack, and now NSW state Liberal MP Catherine Cusack has accused Mr Morrison of politicising the devastating floods.
"I can't vote for Scott Morrison, full stop, at the next federal election," Ms Cusack told the ABC.
"Doing the right thing now won't get my vote because it won't undo the wrong he has done to my community."
She said she no longer recognised the political party she had joined.
Ms Cusack says Mr Morrison is using his role as prime minister to bully the NSW government and flood victims because he is not getting his way.
This was evident in the political appointment of Shane Stone as the co-ordinator-general of the National Recovery and Resilience Agency and using guidelines to exclude some flood victims, she said.
The upper house MP also accused Mr Morrison of failing to engage with the NSW government on assessing and approving payments and co-funding a recent disaster package.
"As a result, those packages are well below what's required and what should be available," she said.
"It is unbelievable anyone would act like this towards flood victims."
Following the attacks from the NSW Liberal, Senator Hume defended the prime minister.
"Scott Morrison has always supported me and my female colleagues within this place. He has a record number of women in cabinet and his behaviour has been impeccable," she said.
"You're going to have to ask (Ms Cusack) what their motivations are.
"Yet because there is nothing to attack this prime minister about on the basis of policy, they attack his character. I think it's cheap and lazy."
A new poll put Labor 14 points ahead of the coalition, in the wake of NSW Liberal senator Concetta Fierravanti-Wells criticising the prime minister's character and trustworthiness.
A Roy Morgan poll conducted in the past week shows the ALP extending its lead to 57-43 in two-party preferred terms - a 1.5 percentage point increase from a week prior.
Senior Labor figures are trying to play down their lead in the polls, with frontbencher Chris Bowen saying the party needed to "win seats, not polls".
Labor leader Anthony Albanese admitted his party had a mountain to climb, having only won from opposition three times since World War II.
"I'm only worried about a poll on polling day," he said.
"We are putting forward a constructive plan for the nation's future - one where no one is held back and no one is left behind."