> I know hiring is not an easy task but why do companies use recruitment agencies where these guys have no idea about programming/IT?
Because most view the time of people who do know something about programming/IT as too valuable to use on the early phase of hiring, so if they weren't doing that, they'd be using in-house HR staff that also have no idea about programming/IT for the role for which they use recruiting companies.
Also, because the recruiters know enough about management of programming/IT companies to be able to sell themselves as knowledgeable about the industry to management.