Why are many funded PhD programmes in the UK not open for non-EU applicants? I once wanted to do a PhD in the UK, but found out that the opportunities were limited for those coming from outside Europe (I did my PhD in Norway instead). I think it is still the case today. I am wondering why this is so. 

EDIT: 

Additional thought: I am wondering, for instance, if the vacancy were open to anyone in the world, would it not increase the chance of getting the best applicants? Also, what differences are there in the UK system compared to other countries (e.g. Norway) which open their PhD vacancies to anyone?
Most PhD funding in the UK comes from Government run research councils, for instance the ESRC, who allocate funds to groups of Universities known as Doctoral Training Centres. Given the restricted level of funding available applications are only open to students who are citizens of an EU member state. Funding may also be available directly from individual University departments but this is so limited in availability that they tend to prefer their own graduates or current students. In either case a requirement for funding is to have a Master's level degree from a recognised University, which is often interpreted as being a UK institution. Basically it's a very small pot of money that's available so applications have to be restricted.

To answer your edit: to get research funding in the UK (certainly for Psychology, and I assume for other subjects as well) you must demonstrate that your research falls into the national research plan. In other words, the UK government is only interested in certain areas of research which will be of long term benefit to the UK economy. While I accept that opening up funding to everyone irrespective of nationality would attract the best of the best, from the Government's point of view there would seem to be little point to spend money helping non-nationals get PhDs if, ultimately, the knowledge and skill sets which they have paid for are then lost from the country due to people returning home once the degree has been completed.