Why can't magnetic field lines intersect with each other?
You are correct. But so is your teacher.
If two magnetic fields are added at a point then the direction of the magnetic field at that point is given by the resultant, which is the same as the direction of the compass needle.
Magnetic fields are vectors and there is always only one resultant no matter how many vectors are added together.
Magnetic field lines do not actually exist. To "see" them we have to use things like compass needles. If we put small compass needles end to end they will trace out a single line. From a different starting point we could trace out another line. Will these 2 lines ever cross? No. If they did the compass where they intersect would point in 2 different directions at the same time. Clearly impossible as your teacher says.
The same can almost be said for electric field lines. [See Why can two (or more) electric field lines never cross?]. The do not intersect except where they start or end on a point charge.
This does not happen for magnetic field lines because there is no magnetic equivalent of an electric charge. Magnets always have a North and South pole - they are dipoles. Even when you chop them up into small pieces each piece always has a North and a South pole. Nobody has ever found an isolated North or South pole - a magnetic monopole.
It is true that magnetic field is a vector, and if you have two magnets, the resultant field is the vector sum of the fields from each magnet. But that isn't what your teacher is talking about when he says field lines never cross.
Iron filings line up with the magnetic field like little compass needles. They show the direction of a field from a single magnet at many points. As you can see, the filings tend to clump together, leaving gaps between them. So they don't show the field at every point. Instead, they show that if you move in the direction of the field, you trace out a line.
The magnetic field really exists everywhere, and is a smoothly varying field. The effect on iron filings was discovered before the mathematics of vector fields was worked out. It is a very compelling picture, and generated the idea of lines of force. Lines of forces are a valid way to pictorially describe a magnetic field. They are still used to this day to show the idea. Lines of force can be made mathematically precise, and uses in laws that describe magnetism.
In the first image, it appears the lines go from one pole to the other. A better picture would show this isn't true. They form endless loops. The loops never cross.
What would it mean if the lines did cross? These lines show the total magnetic field at each point. The field at each point is the resultant of the fields from all the iron atoms that make up the magnet.
It would mean that the total field has two different directions at that point. That isn't possible.
Image 1 is from https://www.forbes.com/sites/startswithabang/2016/07/08/why-doesnt-our-universe-have-magnetic-monopoles/#5443da44380b, but Ethan Siegel. I also found what appears to be the same image at https://en.wikipedia.org/wiki/Magnetic_field, which attributes it to Newton Henry Black, Harvey N. Davis (1913) Practical Physics, The MacMillan Co., USA, p. 242, fig. 200
Image 2 is from http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/elemag.html.