Dear Student,
Inertia of an object tends to resist any change in its state of rest or state of motion.
When a carpet is beaten with a stick, then the carpet comes to motion. But, the dust particles try to resist their state of rest. According to Newton's first law of motion, the dust particles stay in a state of rest, while the carpet moves. Hence, the dust particles come out of the carpet.
Regards