I can understand your discomfort with these kinds of questions. Thank you for your attention and care to question quality on this site.
There has been extensive discussion of policy on these kind of questions in the past. See, e.g., The return of the homework question, Should we have a custom close reason for homework assignment dumps?, Homework policy, Stackexchange promotes cheating, Why isn't CS functioning as MathExchange or StackOverflow?, Should we have a close reason "shows too little effort"?, Towards a homework policy, Answering exercise questions from textbooks where the authors explicitly ask other not to post solutions on web.
As I understand it, the policy we have settled on does not prohibit "homework questions" per se. Indeed, even defining what is a "homework question" is not clear. I've found it helpful to focus on the category of "problem statement questions", i.e., posts that consist solely of a problem statement.
Generally, as I understand it, we do not have a policy of closing problem statement questions. We require that the post contain a clear question, with a clear statement of the requirements or criteria for how answers should be judged. Posts where the question is unclear are suitable for closing.
As for questions where the question is clear but there is no effort, or it looks like a standard exercise-style problem and the poster wants us to solve the problem for them, or it comes off as an attempt to outsource their work to someone else: those are not reasons to close the question, under our current policy. Downvote if you wish, don't answer, and move on. We ask and encourage posters to provide context and to choose questions that will be useful to others (including readers who aren't looking at exactly the same exercise-style problem), but lack of effort is not grounds for closing the question, under our current policy.
Is this the best policy? I don't know. It is what the community settled on many years ago. As one of the moderator team, I try to implement the policy set by the community, as best as I can understand it. My impression is that this is a contentious issue, and the current policy is a compromise that most of the community has been willing to live with. I expect there are a range of views on it. That's not set in stone; the community can always decide to change the policy if it chooses. But unless there is consensus from the community that the policy should be changed, that's the policy we're working from.
And, of course, anyone with privileges to vote to close can choose where and how they wish to cast their votes.
One of the unspoken challenges on this site is that activity has been on the downslope for several years. Quite a few of our most active participants have stopped participating or reduced their participation. I don't see as many people involved in curation or voting to close. This doesn't seem healthy to me, and I don't know what the solution is. I have sometimes wondered if I have closed too many questions unilaterally with my moderator powers, contributing to reduced participation in voting to close from the community.