Malls are designed for both shopping and entertainment. The mall designers ensure you spend as much time and as much money as possible there. When you get tired of shopping, you can rest but still spend money in restaurants or one of the many entertainment points that factor in children.
Those complaining that Nairobi has too many malls are missing the point; these big buildings are designed for the future. Note that most urban centres, including Nairobi, have no sports grounds or parks; shopping including window shopping have become the newest form of entertainment in Kenya. That is likely to be more pronounced in future.