Why didn't Ingenuity (helicopter) deploy immediately right after rover landing?
For many reasons. Number one is that helicopter is an experimental (i.e., not mission-critical) item. Mission-critical aspects took a much higher priority.
Another reason is that Ingenuity deployment requires the Perseverance to move to a flat spot, drop the helicopter from its undercarriage, and then back away. Perseverance happened to land on a good spot for deployment, but that is a bit irrelevant as Perseverance didn't have the capability to back away right after rover landing.
That gets to the final reason, which is there's only so much room on Perseverance's limited data storage for programs. The main flight computer was used to guide the descent vehicle and the skycrane through the entry, descent, and landing process. The software that enables the rover to rove was not installed on the vehicle at the time of landing. JPL long ago developed the ability to upload new software to their remote vehicles. This takes time, lots of time.
Think of how much time it took you to download a program twenty years ago. Now multiply that by a large number. The overall upload takes place in pieces, and each upload has to be confirmed before it is put into place, with a twenty minute round-trip time. The overall process takes weeks to complete.