Why are posts handled inconsistently?
There are many reasons why content on the site may be inconsistently handled. The simplest answer is that different people are viewing different posts and decide to act differently toward each. Since Stack Overflow is largely community-moderated, there is going to be some inconsistency as a result of the democratic process.
That's a little over-simplified, though. There are other factors as well:
Policies change. Nearly every aspect of this site has changed or been tweaked in one way or another over the years. Policies about acceptable questions have changed, generally getting a bit narrower in scope. Answers, too, may be judged by different standards from one year to the next.
If you are going to compare two different posts, be sure to note the date stamp on each. It's possible that a question which was once acceptable may now be off-topic or poorly received.
External influences. Many of the users with voting privileges on the site are not particularly active and may not be fully aware of existing policies and norms. This becomes very evident when some external influence, such as a link from a popular off-site blog or website, drives a great deal of traffic from low-rep users to an otherwise normal post. The reception may be very different than for seemingly identical post that did not get such high traffic.
"Pesky" details. What may appear to be a minor difference between two posts can actually have a dramatic effect on the community's perception of the author's intent. For example, a sentence or two of explanation can help readers to understand that the author is asking a question to fill a gap in the site, rather than to have someone else do the work for him/her. (Though, explanation is no substitute for a well-written question!)
Tone. The "tone" of the post can also make a difference - changing the community's perception from "angry malcontent attempting to circumvent SO norms to get someone else to code for him" to "hilarious dude making a helpful point and brightening my day". (Note that the same post can be interpreted both ways by different people.)
Sentiment. The appearance (or not) of unicorns and/or freehand circles has been known to sway a vote or two.
(This is more of a meta thing.)
There are many, many other factors which are not listed (some are documented here), but the point is that differences in how posts are handled are rarely, if ever, the result of malice or discrimination against the author.
Can we change/enforce policy?
After all of the above is explained, a frequent follow-up is "What can be done to fix this?" usually accompanied with either a suggestion for a new policy or a suggestion for some new enforcement mechanism for an existing policy.
There is a perfectly innocent but misguided notion that policy alone can somehow effect change. Policies are fine and help to give some order to the community, but they are often ignored, both here and in the wider world.
Stack Overflow has largely avoided explicit policy and tended more to allow the community to organize and define itself, within certain flexible parameters. For example, there are guidelines for how to use your vote effectively, and plenty of advice scattered throughout Meta on how to vote in specific circumstances, but these are intentionally left unenforced. Beyond the fact that, as the previous paragraph suggests, enforcement is nearly impossible, rules about voting are not desirable. It would prevent the community from adapting to new circumstances and would change the nature of the site from community-led to a central-authority, where users are little more than automatons executing pre-programmed scripts too complicated for existing AI.
Rather than enforce policy, Stack Overflow has largely opted to help guide behavior via two means:
Features: You can upvote and you can downvote. Downvoting a question costs nothing. Downvoting an answer costs a bit of rep and votes (up and down) are locked in after a few minutes. The rep-cost and lock-in features were developed to combat "strategic downvoting". Rather than trying to enforce a policy, the developers of the site create a feature-set that made strategic downvoting less strategic (costly), but not forbidden.
Another example is the close reason options. Some of the close reasons were, in the opinion of the community and developers, being used inappropriately by inexperienced users. Rather than attempt to force users to somehow follow the existing guidelines (re-education through forced labor, etc.), the close reasons were overhauled to provide more clarity in the hopes that inexperienced users would self-moderate. So far, it appears to be working.
Moderators: Diamond-moderators are a special subset of the community granted additional features (aka "dark energy of the SE universe" - or "magic" to us mortals) to handle specific situations. They have most of the tools necessary to identify and deal with abuse deemed particularly harmful to the community (and where no existing feature is present to deal with that behavior). They can open and close specific posts, restrict a user's access to the site and perform other "janitorial" (aka "magic") tasks. While guided largely by precedent, they are not bound to certain "rules" - they identify and address one issue at a time (occasionally reversing a decision based on feedback or additional information). This flexibility allows them to handle almost any situation, at least on a small-scale.
In general, suggesting a new policy or some enforcement mechanism for an existing policy is both impractical and unlikely to be accepted by the community. In most cases, specific issues can be resolved by moderators and general issues are already handled well by the site's features. Where the features aren't working and the moderators can't keep up, there is generally already a solution in the works (which should be available in 6-8 weeks). If you are relatively new and/or inactive and feel you've identified an issue which No One Has Ever Seen Before™, you may want to carefully research your topic before posting your ideas on how to solve it.