When you apply for a home loan with a bank, they have to follow some processes and spend time and energy to evaluate your application. As you know, all applications to the bank for a home loan are not accepted. By charging a processing fee they are ensuring that the their time was not wasted in a rejected application. However, some banks do waive off the processing fee if the loan gets approved.
Hope this helps.
Kris