Carlo Ancelotti's side struggled to break down a disciplined Villarreal side at Santiago Bernabeu in what was the Italian's 800th game as a coach in Europe's top five leagues.
Arnaut Danjuma went close for the Yellow Submarine in the first half as Madrid failed to register a shot on target before half-time for the first time in a game under Ancelotti.
Madrid's best chance fell to Isco late on but his header was blocked to leave Ancelotti's side three points above second-placed Sevilla, which has a game in hand.
Villarreal showed the early initiative and went close after 15 minutes with the only shot on target in the first half.
Danjuma showed fine skill as he jinked between two Madrid defenders and saw a low shot pushed away by the diving Thibaut Courtois.
Karim Benzema fired wide from distance for Madrid shortly after, while Rodrygo rattled the side netting with a cross-cum-shot.
Madrid's players surrounded the referee as they appealed for a penalty 10 minutes before half-time when Nacho was tackled by Raul Albiol, but he waved them away.
Eder Militao and Benzema both headed wide from good positions for Madrid shortly after the interval as Madrid increased the pressure.
Ancelotti threw on Isco and Eden Hazard in attempt to find a winner, and the former almost found a late winner with a close-range header, but the visitors were able to scramble clear.