Training is like life: Ups and downs.
The older and more experienced you become, the less you care about a bad workout. You always know there is another day. So you don't get worked up about it or let it put you down much.
Life is for most of us not only about training, we also have other obligations. Some of them can include a lot of stress, and this can affect the energy levels.
Planning is always a good thing, and the saying goes: Failing to plan is planning to fail.
So if you want something badly enough, you plan ahead, prepare meals, take them with you, check out which gyms are PL-lifter friendly when you travel etc.
It's all about priority. Given that rest and food is in order, and stress levels are low, and you still have a bad workout it might be that you're just training too much or too hard or both..
After all, I'd say not to worry so much about it. If you have a bad workout, you usually know why. The more experienced you become, the more you know about the reasons for your poor performance. You also stop it from ruining your entire day.