Eventually you will learn about refactoring. Refactoring is about changing a program so that its structure is different, while it does exactly the same thing as before. Two refactoring methods that are often used are splitting a function into two functions, and combining two functions into one.
The art is twofold: First, being able to work focused and refactoring code without introducing bugs. Second, to identify which way is better - in this case, whether the nested loop in one function is better, or the loops distributed over two functions.
By claiming that you should always split nested loops into separate functions, your professor isn't doing you a favour. The split increases total complexity. It's beneficial if each loop on its own is so complex that nesting makes it too complex (Sometimes each loop is already too complex. Combining them would give you something that is much too complex). It's negative if the combined loop is simple enough to be left alone. Your job is to decide which one is it.
Modern languages have features that can actually remove boilerplate code and reduce the complexity of nested loops. Learning to use these features will get you a lot further then having complexity in your code and splitting it up.
And where is the split loop counter-productive? Fact is that a modern computer will likely handle anything you throw at it easily - except nested loops. Iterate through 10,000 items, taking 1 microsecond for each - the user doesn't even notice. Iterate through 10,000 times 10,000 items and it takes 100 seconds. In many cases you must find some better way than a nested loop (if you can't, ask on stackoverflow).
With your nested loop split over two functions, you have one function that calls a function in a straightforward loop - hard to see how to improve that. And you have a function with a simple loop - hard to see how to improve that. Any improvement must consider the combination of both, and you have broken the connection. That makes it harder to see that improving the efficiency of your code is needed, and that it can be done.