Teams of protesters set up camps in Dalkeith Park in a bid to halt the felling of trees to make way for the road.
Eviction experts from Wales were brought in to help remove the eco-warriors amid fears protesters might be injured if inexperienced teams tried to bring them down from the trees.
The Scottish Executive also had to pay more than 900,000 in legal fees and for a police and ambulance presence at the protest site. Details of the costs were released today by Transport Scotland, the newly-established Executive agency in charge of the bypass project.
It took around ten days to remove the 30-strong band of environmentalists, who had established four camps across the park.
The protesters set up camp on the bypass route in November as part of their protest against the plans to build the 40 million A68 bypass road through the country park. They also created a network of underground tunnels.
Once the eviction teams moved in - shortly after New Year - there were dramatic scenes as eco-warriors refused to leave their tree-top and underground hide-outs and had to be removed by eviction teams.
There were reports of tins of beans, custard and Christmas puddings being thrown at members of the National Eviction Team (NET), while one teenage protester suspended herself over a river and a topless eco-warrior was arrested for refusing to wear clothes.
But, in late January, the final two protesters were dragged from the top of a 60ft pine tree.
A spokeswoman for Transport Scotland said: "It's unfortunate that we were put in the situation where we had to go through a legal process, and pick up other associated costs, to remove the protesters so we could continue to deliver the Dalkeith bypass.
"The protesters may have been looking to raise awareness, but they have also raised costs."
Transport Scotland said the bulk of the 1.5m was spent on legal fees - around 909,000 - as eviction notices were needed from sheriff officers.
Lothian and Borders Police was paid 486,000, and the Scottish Ambulance Service ran up charges of 13,400.
Other costs were paid to Midlothian Council and highway maintenance firm Amey for organising traffic management near the site, putting up fencing and plant hire.
East Lothian Labour MSP John Home Robertson, who supports the building of the bypass, said: "I can think of a lot of better things to spend this amount of money on. For a self-indulgent minority to get involved in a stunt like this, who were able to add to the cost very significantly, it does raise serious questions."
The protesters' homes in the trees have since been destroyed to make way for the bypass. Work on building the road is due to start in the summer.
A campaign group separate from the eco-warriors - Save Dalkeith Park - is still fighting to stop the road from being built. Members are angry that the only public local inquiry which considered the case for construction of the bypass was held in the 1990s.
Jade Allison, a member of the group, said: "This seems like a huge waste of money. It could have been spent on a public inquiry.
"It should not have been necessary for people to feel forced into climbing trees, but I can see why they did it. Many of the protesters who were in the trees were probably only just born when the public inquiry was held."