Check it out again:
21 Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven.
22 Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works?
23 And then will I profess unto them,I never knew you: depart from me, ye that work iniquity.
WHO do you think Jesus was speaking of in verse 22? WHO do you think does all that stuff in HIS name?
Also: The word "iniquity" comes from the Greek word "anomia". Thayer's Greek lexicon defines it this way:
BDB/Thayers # 458 anomia {an-om-ee'-ah} from 459; TDNT - 4:1085,646; n f AV - iniquity 12, unrighteousness 1, transgress the law + 4060 1, transgression of the law 1; 15 1) the condition of without law 1a) because ignorant of it 1b) because of violating it 2) contempt and violation of law, iniquity, wickedness And Strong's Lexicon defines it: "illegality (i.e. violation of the law)
Iniquity = sin = turning away from God's LAW.
This is an interesting verse, too:
John 10:38
But if I do, though ye believe not me, believe the works: that ye may know, and believe, that the Father is in me, and I in him.
This one makes it look like works come before faith and that works are more important. Though you believe not me... BELIEVE THE WORKS.