You didn't really do anything wrong, per se, so there's really nothing to feel guilty about. There are more effective means to get your point across to this dog, however, as has been mentioned by others.
The bottom line is, dogs cannot be allowed to bite humans, period. When a dog does, punishment is in order, otherwise they ain't going to learn their boundaries.