Actually, unauthorized recording of a lecture is more of a violation of privacy than a theft. It’s a secret surveillance thing, not a bootleg thing.
Borrowing notes is “frowned upon” by schools because they want you to take your own notes. However, it’s ultimately no different than if you just asked your friend to reiterate what the teacher said, and you took your own notes from that. It’s not stealing.
If your school absolutely forbids copying notes, then it’s a matter of obedience to the people put in charge of you in school, but it’s still not about stealing.
If you borrowed your friend’s notes without asking, it’s a matter of possible impoliteness, but not stealing. Unless you kept their original notes and didn’t give them back.