Labour’s Russell Brown, who represents Dumfries and Galloway, said cuts meant illegal immigrants could walk off a ferry and onto the UK mainland.
Immigration Minister Damian Green said the Irish Sea ports were domestic travel hubs where passport controls would not be appropriate.
Mr Brown insisted they were a “well known route” for illegal immigrants.
He said the ports were also targeted by organised criminals smuggling contraband goods and illegal drugs.
The Dumfries and Galloway MP has raised regular concerns about the loss of three UK Border Agency staff at the Galloway ports.
He also claims the Scottish government has cut police numbers.
“The Galloway ports have suffered a double whammy of cuts first from the SNP government in Edinburgh and then from the Conservative-led coalition government,” he said.
“I’m calling on the UK government to consider either reinstating the UKBA financial support to Dumfries and Galloway Police or provide UKBA staff at the port.
Continue reading the main story
They are not designated ports within the meaning of immigration legislation, they are not international ports like Dover”
“UKBA failed to plan how the port would cope with the withdrawal of funding.”
He claimed the cuts were “rushed through” in a matter of weeks.
“The consequence is not only that the government has reduced security at the port but they left it exposed for almost a year until they decided how to try and compensate,” he said.
“The minister needs to tell us why he is not doing anything to close this massive loophole in our border security.”
Mr Green said the government was doing what it could, but that Stranraer and Cairnryan, which run services to Northern Ireland, were not international borders.
He said: “I’m sure you recognise, and what I need to make explicitly clear, is that Stranraer and Cairnryan are domestic ports.
“They are not designated ports within the meaning of immigration legislation, they are not international ports like Dover.
“The ferry links between Northern Ireland and Scotland are domestic UK services.”
He said that meant that in legal and immigration control terms they were “no different” to ferry services between the Scottish mainland and the Western Isles or between Hampstead and the Isle of Wight.
“There are no international accesses from Stranraer and Cairnryan and any international country,” he said.
“So we must be clear we are talking here about people moving within the UK, we are not talking about people coming into the UK.
“I’m sure you recognise it would be wholly inappropriate to introduce passport controls at domestic UK ports.
“Northern Ireland is part of the United Kingdom and people within the UK are not subject to border controls and nor should they be.”
He added that all the agencies involved were working together as closely as possible to ensure borders were as secure as they could be.