Why does it take two days to complete the rebalance?

When you sell stocks as a part of your rebalancing, you will receive the sale proceeds only on the next trading day. On the next trading day, the buy are using the sale proceeds received. Then, the next day. i.e. the second day after you execute the rebalance,  bought are settled in your . Here’s a breakdown of this:

Day 0 – You execute the rebalance and recommended stocks are sold
Day 1 – You receive money from sold stocks. Recommended stocks are bought 
Day 2 – The bought stocks are credited to your demat account