This can be a difficult topic, especially if teachers are paid only for the time they teach. Some of them may feel it’s not necessary to plan and don’t want to because of the unpaid time they have to dedicate.
However, I think it’s important to have a plan as this gives structure to the lesson. If the teacher is inexperienced, a plan gives them the confidence needed to deal with the lesson. If the lesson is planned, the students can see the structure. They know where they are headed, especially if the teacher makes the plan explicit. This could be in the form of an outline on the board or a brief explanation at the beginning of the lesson.
Having said this, the plan can be just a framework that shapes the lesson. If the teacher has overall aims for the course and has the aims of the lesson firmly in mind, then a framework can be sufficient. Experienced teachers can get away without planning from time to time especially if they know the coursebook and the students well. I don’t think it’s a good idea to make a habit of it, though.
Having said this, I also think it’s important to be flexible. If you have planned to present a difficult grammar point or to tackle a difficult listening, it is probably wiser to abandon this if you see the students are more tired than usual. It’s also a good idea to take advantage of an opportunity to teach language in context as and when it comes up. If a language point comes up naturally and the students are interested, they are more likely to engage with it. This will make it more memorable for them.