Team bonding is good and valuable because it improves communication, trust, and teamwork.
Try multiple kinds of bonding events, such as all-hands, kick-offs, offsites, outings, fun events, etc.
Respect people's differences. Examples: people who are in AA may not be able to go to bars for beers; people who have children may not be able to do after-hours events; people who have commitments may not be able to do ad-hoc events.
An all-hands meeting gathers the whole team, or whole organization, in order to discuss company updates. All-hands meetings are valuable because they ensure everyone who is involved receives the same information at the same time in the same way.
A kick-off meeting usually marks the official start of a project or project phase. The meeting typically includes the whole team, and can also include clients and stakeholders. A kick-off meeting establishs a positive atmosphere, and helps align the participants and the project goals.
An offsite meeting is a meeting that takes place outside of the office. The goal is to get your team together for focused work: this could be to discuss big picture strategy, or plan long term goals, or do deep work on large projects. The change in venue gets teams in a different headspace, removes office interruptions and distractions, and provides neutral territory for inter-group collaboration.
An outing is group journey outside of the office, such as a visit to a customer site, or trade fair, or industry conference. The goal is typically education.
A fun event is a way to encourage teammates to get to know each other personally in a friendly setting, for example going out to lunch together, or to a movie together, or to a sports game.
Fun bonding events may be better if work is set aside for the event. For example, some teams say "tonight we'll try to not talk about work". Some times use a "swear jar" idea in order to help lighten the mood: if someone does talk about work, then they put a dollar in the "swear jar".
Bonding events that emphasize alcohol tend to be problematic, because some people may not be able to participate, or may not want to participate. For example, some people are sober and do not want to go to a bar with colleagues.