SO, you mean the money was just sitting there? Budgets are passed annually by Congress (supposedly), something from 10-11 years ago does not have the money still sitting there.
In the fiscal world, there are two important criteria to consider. One is approval of a project. In the govt world, this is called an appropriation such as the Secure Fence Act of 2006.
For our case, Congress approved the project expenditures to build a wall.
The other is yearly expenditures that will be used to actually spend the money to build that wall.
As for all years since Obama took office, our feckless Congress has allowed a continuing resolution to be approved instead of a budget. At the present time, we are operating under a continuing resolution passed by Congress until the end of April, 2017.
A continuing resolution allows all federal agencies to spend the same amount of money that they had the previous year. Little strings attached and what is really bad, little accountability.
From what I understand, DHS has its money in this continuing resolution. Diverting it to an already-approved project like the wall should not be a problem for it.
This is my understanding. If any have better details, please post and inform the rest of us.