They were not just trying to win the match but they attempted to qualify with a better run rate and doing so lost the match. They needed to chase this target in 37.1/2 overs but luck wasn't on their side tonight. If qualification wasn't on the table then they were surely winning the match.
I also think that Afghanistan batters not aware of the exact equation lost the last two wickets for zero runs and Rashid Khan remained off strike. Now Pakistan, India from Group A and Bangladesh and Sri Lanka from Group B quality for Super Four teams of the Asia Cup 2023.