A swing is a strike even if the batter gets hit.The only thing that a pitch in the dirt cannot result in is a called strike. If the batter had swung and gotten a hit, or been put out would the umpire still have said it was a ball? You handled it well, but you could have asked the umpire (in a calm, even semi-joking tone of voice) that exact question.