Lopez, who shared goalkeeping duties with Iker Casillas last season, completed a move to AC Milan last month following the arrival of Keylor Navas, and Ancelotti understands why the 32-year-old needed to leave La Liga.
"In Madrid he was competing for a place with Casillas. He has decided to take on a new challenge, a different style of football in a different league," the Italian told Il Giornale.
"He's a quality keeper, hard-working and dedicated. He wanted more stability which is why he left Madrid."
Lopez made 36 appearances in La Liga last season.