Answer: The director. (With one caveat, explained at the end of this post.)
When you are watching a movie and it turns out to be absolutely horrible, there may be many reasons why. Perhaps the actors are just untalented or doing a piss-poor job at it, like their heart is not in it. Perhaps the script is just bad, full of ridiculously poor dialog, naive plot twists, plot holes and illogical events. Or perhaps the story is just outright boring, or badly written. Perhaps the props, costumes and visual effects are so bad that they ruin the movie (and aren't even of the "so bad it's good" kind).
However, there is one person who always carries the ultimate blame for a bad movie: The director.
The movie director is the person who is responsible to make the movie good. He or she is the person who is ultimately responsible for catching mistakes and fixing them. For noticing bad actors, and fixing (or replacing) them. To make sure that props and effects are good even if the budget of the movie is small. (A small budget is not an impediment in making a great movie. Some of the best and most highly appraised movies in existence have had ridiculously small budgets, even in the few thousands of dollars. It of course requires talent to pull it off, but a good talented director can demonstrably do it.)
In a sense, the director is the "last line of defense" against all things that could make the movie bad. The director must notice when something is wrong, and fix it, rather than letting it slide. You can blame eg. the scriptwriter for writing a bad script, or an actor for being completely untalented or doing a poor run-of-the-mill job, but ultimately it should have been the director who should have caught the problem and fixed it. The director should have required a rewrite of the script, or instructed or even replaced the actor.
I suppose that my point is that the next time you see a bad movie, be aware who you should point your finger primarily at. Look at who the director was.
And that caveat: Sometimes even a great director will release a botched movie, but unwillingly. This happens with meddling executives who want their fingerprints on the movie and go over the director's head and require changes that the director doesn't approve of. In some cases this has been so bad that the director has completely disowned the movie (one of the most common ways of doing that is to use the pseudonym Alan Smithee, which is a codeword for "I disown this movie, I don't want my name attached to it". Although this practice has apparently been discontinued for some reason.)