The comment of marmot above notes a key aspect of this issue: many questions are badly asked, but still answerable, and the answers to such questions can be good, so the question does not deserve an upvote while the answer does.
A question can be bad because it lacks an MWE or the MWE is too long, which means that the answerer needs to spend time making an MWE or trimming it down. Or the question fails to specify what the error is or what the desired output is, which means the answerer does not know whether or not he is solving the right problem and whether his solution is correct. Or the question shows code in a screenshot. Or the question shows too much or too little backgorund information. Or the question is is clearly made up and unrealistic - etc. etc.
If, despite all the extra work and guessing involved, somebody answers the question, and the answer provides clear code, good explanation, a screenshot of the result, etc, then I think an upvote for this answer is deserved.
Note that I do it the other way around as well, i.e., vote for the question and not the answers, because I want the electorate badge :)