Firstly, court costs and Legal Aid are two entirely different things.
Court costs are a contribution towards the costs of bringing the proscution. Legal Aid is provided to assist you with the costs of your defence. You need that defence whether you are convicted or not and the CPS is not liable to repay your defence costs - whoever met them - if you are acquitted.
The system for granting Legal Aid in the Crown Court is explained here.
http://www.justice.gov.uk/legal-aid/assess-your-clients-eligibility/crime-eligibility/means-test
The important point to note is this:
"In the Crown Court, if a defendant passes the Interests of Justice test they will automatically be entitled to legal aid.
However, around 1 in 4 defendants have to contribute towards their defence costs. The type of proceedings a defendant is facing in the Crown Court will determine how the means test will be applied."
So it seems likely that you are among the 1 in 4.