...why do they accept costs of shutdown?
It's not only costs. They also oppose the idea of the wall during the campaign to midterm elections. They argue that the voters wanted them to not build a wall.
Some quotes from Democrats stating explicitly that it's not only about the costs:
..are we a country that puts a wall between ourself and an allied nation or do we use smart security measures..
Reps. Eric Swalwell (D-CA)
..The Democrats do not support the wall..The wall is, in my view, immoral, expensive, unwise ...Building a wall is not an answer ... Speaker Nancy Pelosi (D-CA)
Democrats have always been for smart and effective ways to secure our border .. We are pushing for technology, like drones and sensors and inspection equipment. Senate Minority Leader Chuck Schumer
Additionally, they might be afraid to show any weakness. If they can be persuaded to agree to something that they don't want to by a shutdown, they might become vulnerable to repeated extortion in this way.
You could ask the same the Republican side if a shutdown that presumably costs billions is really a good way to secure funding for a comparable, larger or possibly smaller project. Money doesn't grow on trees and at some point there won't be anything left to build a wall.
As it is, it is a loss-loss situation for both sides, but that is the general result of Government shutdowns in the US. The division of power in the US political system has a lot of advantages but also some disadvantages including this kind of gridlock.