It's in the gray area between unethical and simply poor teaching pedagogy, if it happened as you described. (My typical experience is that neither the instructor nor the students* quite have an accurate account of what happened. I have sat in on enough classes as a disinterested party to notice this....)
The reason it is poor teaching pedagogy is that you reward students who ignore you, and penalize those who do what you ask. "Review X" might indeed be good advice for mastering the material, but if you do this before an exam it's implicit that this is going to not just help you with the material but also help you with the exam. Not everything the lecturer mentions might be on the exam--after all, the exam has length limits--but if it's almost a complete mismatch, the lecturer has just badly undermined their credibility. Maybe they only mentioned the parts that they thought students might overlook (knowing the rest is so obvious it "doesn't bear mentioning", perhaps!), but it still speaks poorly of their judgment and the value of paying attention to them. Even if they honestly wanted to improve the students' knowledge, this isn't the way to do it.
It is unethical if it gets to the point where it's downright duplicitous; where the lecturer knows full well that the advice is bad advice for the exam (rather than e.g. just advising that the students cover everything, or not really knowing what they'll pick out to cover on the exam), and is using students' drive to do well on an exam to get them to study material that the lecturer for some reason feels is very important to know and yet not important enough to test. This is about the same as holding a big gold coin casually in one's hand while asking someone, "Hey, if you give me $20, I'll give you a gold coin!", then collecting their money and pulling out a pinhead-sized gold coin and giving it to them. It's duplicitous even if the duplicity occurs entirely within the realm of inference/implicature. I wouldn't necessarily assume any particular lecturer was doing this instead of just being a bad teacher, but if they were it would be unethical.
However, randomly sampling from all topics covered is a fair and even expected way to deal with having more material to cover than can reasonably be assessed during a test. It's not completely fair in that it is an error-prone measurement of student ability (people who particularly struggled with those areas but excelled at the others will do anomalously badly, and vice versa for those who had problems elsewhere but got what was tested), but alas, in a group instruction setting it's extremely difficult to be completely fair. Mostly fair is about as much as you can hope for (on a reasonable budget). From what you've described, I cannot distinguish the lecturer's behavior from this, so I would tend to give them the benefit of the doubt (and tend to give you the benefit of the doubt that you haven't yet encountered this sort of style and thought about why it may be necessary). And if there's another exam to come, well, there's a good chance that some other portion of the material will be covered then (this is also extremely common practice).
*(Aside: when teaching, I have had students honestly come up to me and complain that an exam is "nothing like" a sample exam when the sample contained a question analogous to "If Jim has five oranges and Sally has two oranges, and they share equally between themselves and Jane, how many oranges does each get" and the actual exam contained, "If a puppy has a bowl with two cups of water, a kitten has one with one cup of water, and they and two lambs all drink the water, sharing it equally, how much water will each drink?". In this case, the problem is that the student is too fixated on the particulars--"there's no Sally! No oranges!"--to actually know the material at all. So of course, when the irrelevant details change, the student is completely flummoxed, and yet the test is a good test of their skill, and the practice test should have been good practice. Part of learning how to learn is understanding how not to become one of these students--understanding when you're capturing the material at the right level of generality and with the right number of details. A really good teacher will help bring this out, but it's really difficult to teach, so it's mostly up to you.)