The amendments were originally made in the Senate, and under the constitution the Senate is not allowed to make bills increasing the spending of public money.
The laws now go back to Senate where they are expected to be approved.
Following the defeat, Prime Minister Scott Morrison attacked the "damaging impact of what Labor has done tonight".
"He (Bill Shorten) cannot be trusted on our borders and Australia cannot trust Bill Shorten on border protection," he said.
"And he will not make Australia stronger.
"Less than 24 hours ago I warned Bill Shorten would make Australia weaker, and the Labor Party would weaken our border protection and they could not be trusted to do the right thing to secure Australia.
"Within 24 hours...the Labor Party has proved me absolutely right.
“The Labor party and Liberal-National party are not on the same page when it comes to border protection. There is no bi-partisanship on this issue," he added.
Despite heavy pressure from the government, six crossbench MPs sided with Labor to inflict a series of defeats on the coalition on the floor of the lower house.
"I believe we can keep our borders secure, we can uphold national security, but still treat people humanely," Labor leader Bill Shorten told parliament on Tuesday.
However, he ruled out going to an election - telling reporters the federal election would be "in May, after the Budget".
The fiery attack on Mr Shorten followed an earlier exchange on the chamber floor.
Mr Morrison told Mr Shorten Labor was trying to "kid themselves" that the changes were being made in the name of humanitarianism.
"I remind them that their humanitarianism, as supposed, last time led to child deaths, it led to the total destruction of our borders and it took the strength again of a coalition government," he yelled across the chamber.
Scott Morrison suffers historic defeat as asylum seeker bill passes
"The people of Australia will remember this day and know that this is now on your head - leader of the opposition."
Under the negotiated amendments, a medical panel of two doctors would assess requests for medical transfers from Manus Island and Nauru.
The Home Affairs minister would have 72 hours to make a decision on whether to agree to a medical transfer.
The minister will only be able to reject the transfer on national security grounds or if the person has a substantial criminal record and poses a threat to the Australian community.
The doctors were due to be paid under the original proposal - but Labor's late change to exclude remuneration means the bill cannot be rejected on constitutional grounds.
Solicitor-general Stephen Donaghue QC argued the amendments could breach the constitution because of the payment issue, but ultimately it was up to parliament to decide if they did or not.
With the constitutional issue no longer relevant, the coalition avoided a potentially disastrous defeat on an appropriation bill.
HOW LEGISLATION TO MAKE MEDICAL TRANSFER FOR REFUGEES EASIER WORKS
* A medical panel of two doctors would assess requests for medical transfers of people currently on Manus Island and Nauru, but not new arrivals.
* Home Affairs minister would have 72 hours to make a decision on whether to agree to a medical transfer.
* The minister can reject the transfer on national security grounds or if the person has a substantial criminal record and poses a threat to the Australian community.
* If the minister refuses the transfer for another reason, the decision is referred to the eight-member Independent Health Advice Panel.
* The panel can then reassess the reasoning before choosing whether to make a second recommendation for transfer.
* The health advice panel includes the Home Affairs Department's chief medical officer and the Commonwealth chief medical officer
* It also has at least one person nominated by each of the Australian Medical Association, Royal Australian and New Zealand College of Psychiatrists, Royal Australasian College of Physicians and one with expertise in pediatric health.
* The panel won't be paid, a move designed to remove doubts over whether the bill was unconstitutional.