Is it appropriate for a professor to require students to sign a non-disclosure agreement before being taught?
No. It’s not appropriate and this is an obvious, blatant abuse of authority. I have a word in mind to describe this professor, but unfortunately am not free to disclose it as I am under an NDA. (It starts with an “i” and ends with a “t”).

Edit: to those asking “why not?”: teaching the class is the professor’s job. He is literally (in the literal sense of “literally”) required to teach the lecture and to allow any registered student who isn’t being disruptive to attend it, without setting any preconditions. And of course this swearing of students to legally binding secrecy is even more absurd than other types of conditions, considering the students are there to acquire knowledge they’ll need to use later in their studies and career. The whole “I’ll teach you but you have to promise not to tell anyone about it” thing reads like something straight out of Catch-22.