But if a defending player commits an offence and a goal is not scored the pk is retaken.You have to look at this as a whole. Yes an attacker commited a minor offence at a PK which in your case didn't even impact the PK. But why did you award the PK in the first place? Let's say it was due to a attacker being through on goal and fouled by the "last man" attempting to play the ball in an almost certain goal scoring opportunity. You don't allow the retake after the PK and the team with the clearly bigger offence is the winner here.
The law was written in a way to be fair on both sides and rebalancing of the situation by looking at the bigger picture.
All seems stacked against the defending team?