I'm pretty sure the agreement says nothing about what kind of keyboard you should use :) But if Apple wanted to specify that in their license, that's entirely within their rights.
Please feel free to cite some examples of people saying it's illegal for Apple to do this. You won't find any, because that's not the argument at hand. There's a difference between complaining about something and saying that it's illegal.
"It is acceptable for Apple to sell its hardware/software under any kind license that it wants to, as long as it isn't illegal."
I was a top level post in this thread, responding to the article. Go read the article and then go and read my top post. The topic here is "Is Apple Insane." (Answer: No. They have valid strategic business reasons for doing what they are doing.) and "Are these policies acceptable." (Answer: Certainly, what they are doing is not illegal, and appears to be working successfully for them.)
Do you have to like it? No. Do you have to put up with this awful, sorry treatment. No. You can take your development efforts elsewhere. Develop for Android or WindowsWhatever.