"So it tasted the consequence of its affair," meaning: the punishment. "And the outcome of its affair was loss," they lost Paradise through it.
﴿فذاقت وبال أمرهَا﴾ يَعْنِي: الْعقُوبَة ﴿وَكَانَ عَاقِبَةُ أَمْرِهَا خسرا﴾ خسروا بِهِ الْجنَّة