I see a few things at play here.
First, I don't think mentioning a birthday is at all a play for attention. It's just something happening, and I agree with the PP's that the correct response is just 'Happy Birthday' and then move on. I think it's actually a little unkind to suggest that just saying the words "It's my birthday today" is somehow a bid for attention that obligates a response. It's a pretty normal social convention to mention interesting but casual things that are happening to you when someone asks how you are or what you're up to.
Secondly, why you went out seems like important context to me. Did you leave the office specifically to go out and purchase a balloon and cupcake, or did you have to go out anyway and just grabbed them? Making a specific trip out to buy something - even something small - and then seeking that person out to give it to them implies a level of closeness that a client/coworker relationship doesn't seem to have. I would do that for a close friend or family member, but not for a casual friend or coworker. However, if I was already at the store and I knew I'd be seeing someone later, I might grab something handy for someone I wasn't so close to.
I can see a coworker being a little surprised and feeling awkward about receiving something you make a special trip out for if that person doesn't perceive your relationship as close. Especially the balloon, I have to add. I may love a good balloon, but not at work - then you have to figure out what to do with it, and stuff it in the car if you're driving home. A scratch-off ticket is cheap, casual, and unobtrusive, but a birthday balloon is somewhat less so.
I definitely wouldn't apologize, though. That's just making it into a bigger deal than it needs to be. You weren't rude, after all. Just carry on and maybe stick to a simple scratch-off next year.