All requirements on a job application, from degrees to the technical, are all subject to negotiation. If a job requires JavaScript but you can demonstrate that your other skills more than make up for it (and you can learn) then maybe you'd still be a hire.
As with any kind of transaction in business, the terms of employment are negotiable. A job posting is simply an initial ask.
Ethics are another question, but the rationale is clear.
After all, it's the law that fails to recognize that 7 years of experience in different environments may trump having a degree. Policy makers recognize this and allow the situation to exist because they know that you're not going to get residence for the 7-year-no-degree dude, you're going to get it for the 5-year-Masters-from-CMU fellow and it's better to have that guy in than out.
So, you lie about your actual requirements (how hard is it to add the classic “or equivalent experience” qualification?) and expect potential applicants to intuit your hidden meaning?