McIlroy, who dropped from second place to a tie for fourth entering the final round, referred to the penalty as part of golf's "stupid rules."
The 24-year-old from Northern Ireland had hit his drive on the second hole onto a gallery crosswalk. He was given a free drop for relief, but when he played his shot he had one foot on the line marking the drop area.
"I didn't even know my foot was on the line," said McIlroy, who was told of the violation by the caddy of playing partner Ricardo Gonzalez. "We went back to see it again there and see where my divot was, and it was clear that I couldn't have played the shot with my feet anywhere else.
"I guess I was so much into the shot I didn't even realize .... There's a lot of stupid rules and this is one of them."
Craig Lee of Scotland leads the tournament at 12-under-par 204, with Phil Mickelson and Gaganjeet Bhullar of India tied for second at 10 under. McIlroy is tied for fourth with Pablo Larrazabal of Spain at nine under.
McIlroy tried to look on the bright side.
"To a spectator it may feel like I have been unduly punished, and that's what it feels like to me, but it's a rule of the game," McIlroy added, leaving out the word stupid. "I do feel like I have been hard done by [the penalty] but it's nothing that a fast start tomorrow can't fix."