There are a few reasons why Leonardo DiCaprio may have dropped out of the film Nightmare Alley. One reason could be that he was simply too busy with other projects. At the time, DiCaprio was already attached to two other films - The Aviator and The Departed - which were both scheduled to begin production around the same time as Nightmare Alley. It's possible that DiCaprio decided to focus on these two films and let go of Nightmare Alley in order to avoid over-committing himself.
Another possibility is that DiCaprio wasn't comfortable with the film's dark subject matter. The original script for Nightmare Alley, written by William Lindsay Gresham, is said to be much darker and more graphic than what ended up onscreen. It's possible that DiCaprio read the script and felt uneasy about taking on such a dark role. Whatever the reason, it's clear that DiCaprio made the decision to drop out of Nightmare Alley for personal reasons.