Either companies shouldn't be required to post publicly with the intent of hiring internally or an employee getting a referral kickback, or something needs to be figured out where the applicants aren't taken advantage of.
The federal government can (and routinely does) ask mid-sized to large companies for records of their job applicants to "prove" they are not discriminating against protected categories (women, minorities, the disabled, etc).
So if the CEO/hiring exec wants to hire his good old boy friend to a position no matter what the job will still be posted and applicants will be collected even if they have no chance of being hired.
Obviously I have no data on how prevalent this practice is but I've witnessed it firsthand, so it happens.