When Aghāsura was being killed by Kṛṣṇa, who was accompanied by His associates, Brahmā was astonished, but when he saw that Kṛṣṇa was very much enjoying His pastimes of lunch, he was even more astonished and wanted to test whether Kṛṣṇa was actually there. Thus he became entangled in Kṛṣṇa's māyā. After all, Brahmā was born materially. As mentioned here, ambhojanma janiḥ: he was born of ambhoja, a lotus flower. It does not matter that he was born of a lotus and not of any man, animal or material father. A lotus is also material, and anyone born through the material energy must be subject to the four material deficiencies: bhrama (the tendency to commit mistakes), pramāda (the tendency to be illusioned), vipralipsā (the tendency to cheat) and karaṇāpāṭava (imperfect senses). Thus Brahmā also became entangled.
Brahmā, with his māyā, wanted to test whether Kṛṣṇa was actually present. These cowherd boys were but expansions of Kṛṣṇa's personal self (ānanda-cinmaya-rasa-pratibhāvitābhiḥ (BS 5.37)). Later Kṛṣṇa would show Brahmā how He expands Himself into everything as His personal pleasure, ānanda-cinmaya-rasa. Hlādinī śaktir asmāt: Kṛṣṇa has a transcendental potency called hlādinī śakti. He does not enjoy anything that is a product of the material energy. Brahmā, therefore, would see Lord Kṛṣṇa expand His energy.
Brahmā wanted to take away Kṛṣṇa's associates, but instead he took away some other boys and calves. Rāvaṇa wanted to take away Sītā, but that was impossible, and instead he took away a māyā Sītā. Similarly, Brahmā took away māyārbhakāḥ: boys manifested by Kṛṣṇa's māyā. Brahmā could show some extraordinary opulence to the māyārbhakāḥ; but he could not show any extraordinary potency to Kṛṣṇa's associates. That he would see in the very near future. Māyārbhakasya īśituḥ. This bewilderment, this māyā, was caused by the supreme controller, prabhavataḥ—the all-potent Supreme person, Kṛṣṇa—and we shall see the result. Anyone materially born is subject to bewilderment. This pastime is therefore called brahma-vimohana-līlā, the pastime of bewildering Brahmā. Mohitaṁ nābhijānāti mām ebhyaḥ param avyayam (BG 7.13). Materially born persons cannot fully understand Kṛṣṇa. Even the demigods cannot understand Him (muhyanti yat sūrayaḥ). Tene brahmā hṛdā ya ādi-kavaye (SB 1.1.1). Everyone, from Brahmā down to the small insect, must take lessons from Kṛṣṇa.