Both companies had argued that the UK's Digital Economy Act was incompatible with EU law.
Under the terms of the Act, ISPs will have to send warning letters to those who allegedly illegally download files, with threats to cut them off if they don't desist.
The firms' lawyers argued that such measures could be an invasion of people's privacy lead to higher costs for them and their customers.
In a statement, Talk Talk said it was now "considering our options".
"We're disappointed that our appeal was unsuccessful though we welcome the additional legal clarity that has been provided for all parties," the company said.
"Though we have lost this appeal, we will continue fighting to defend our customers' rights against this ill-judged legislation."
A spokesman for BT told the BBC: "We have been seeking clarification from the courts that the DEA is consistent with European law, and legally robust in the UK, so that everyone can be confident in how it is implemented.
"Now that the court has made its decision, we will look at the judgement carefully to understand its implications and consider our next steps."