Because when your APC’s start to go obsolete, why not just fill the crew compartment with huge stashes of ammunition for a 20mm Vulcan gatling cannon?
All jokes aside, the M163 was designed to be a competitor to the ZSU-23-4, AKA the “Shilka”. They were used to support ground units from aerial attacks, but were also used as indirect support weapons, firing on anything they could depress their guns far enough to shoot. Overall, the M163 “VADS” had an unimpressive career as mobile AA. It was later replaced by the M1097 Avenger and the M6 Linebacker.