The balloon was brought down with a missile that had the primary explosive removed, it basically just flew through the balloon. This being the F-22's first air-to-air kill after nearly 2 decades in service, it's not like these missiles are a precious resource to be conserved. It also would be quite embarrassing to attempt to shoot down the balloon and fail, so it makes sense to go for a guaranteed kill.
Finally, it should be noted that the balloon was at approximately 60,000 ft. The F-22's flight ceiling is above 50,000 ft, but the exact value is classified. It is possible that the F-22 simply could not get up high enough to engage with guns even if that was desirable, or it's also possible that the F-22 is capable of flying that high but the US did not want to confirm that to a potential foreign adversary. In general it is also just good practice to keep some distance between your most capable assets and foreign espionage devices.
As one can see from video of the encounter, it was very effective in bringing the balloon down in a controlled manner. It's one thing to monday-morning quarterback a failure, but this is ridiculous.