Why did Dave send the trolls all of that money? What did they use it for?

Dave sent them that money because Terezi told him to. It was getting that money from Dave that alerted the trolls to the kids.