Because the UK is signed up to the ECHR....nothing to do with 'foreign' judges as such...they just apply the law.
The court could have been set up in London.
The European Court of Human Rights is made up of one judge from each of the 46 member states of the Council of Europe. The Council was set up in 1949 to promote democracy, human rights and the rule of law.
Each judge is elected for a single, non-renewable nine-year term, and is required to be independent and impartial while carrying out their judicial functions.
Tim Eicke KC is the current UK judge at the Court.