Legal? Probably not, but he has no recourse. But it reminds me of when people call the cops and say "arrest that person; they stole my drugs!"
My point is, this was definitely a bug in the app store, because before any charge there should be a clear modal confirmation dialog (and there normally is).
For instance, my cable company recently shut off my Internet due to excessive DMCA complaints. They told me they had a "four strike" policy. They cut me after three. I could threaten a lawsuit, even if it would be silly, but that would potentially open me up for other legal attacks, so I'm forced to walk away.
So all I'm saying is that they got you in a tight spot, and they've probably paid enough lawyers to make sure they're covered. Their hardware detected software, so they charged you for it. I find it hard to imagine they haven't written it up to cover themselves.