No, I think it's a good question.
It is required in the second question, and incorrect in the first.
I find that the easiest way to understand how English questions are formed is to make declarative statements from them, and note how the sentence changes as a result. Let's take your examples one by one.
What is meant by "It is all Greek to me"?
This would be the most standard way to phrase the question. To make it into a statement, logically we must first decide what the answer is. Let's call the answer A. Then the declarative version would be
A is meant by "It is all Greek to me."
"It" is not required, because the sentence already has a subject, namely A.
(Incidentally, this sentence is in the passive voice. Putting it in the active voice results in the simpler
"It is all Greek to me" means A. So changing active to passive changes which thing acts as the subject. However, the passive voice really is the best way to phrase the original question.
"It is all Greek to me" means what? is at best an informal phrasing.)
Why is it necessary to behave well?
Again, this would be the standard phrasing. Unlike the previous example, we can make a simpler question by simply eliminating the word "why":
Is it necessary to behave well?
From here, the declarative version is easy—just put the subject and verb in the opposite order, which were reversed to form the question. Notice that, also unlike the previous example, we can do this without deciding what the answer to the original question is.
It is necessary to behave well.
There's no way to write this sentence without "it," because the sentence wouldn't have a subject otherwise.
If you find this to be a good way of understanding the issue, please let me know in a comment. Likewise if you feel confused by it.