The weapons are city property. Thus, they are owned corporately by the people. Giving them away without authorization is not right.
They don't give them the patrol car upon retirement, why the gun? There are plenty of discounts by manufacturers for LEOs; I find it hard to get my ire up over this. If they want to be sure to have a weapon for protection after retirement, I might suggest they contact their local gun store and ask about Glock's LEO discount.
If it is such a big deal to keep them, then let the city council adopt a policy authorizing the giving away of the personal sidearm. I don't know that the people of the municipality would begrudge a faithful public servant completing many years of service a gun that cost a couple hundred bucks. I probably wouldn't gripe too much about my own police dept. doing this, so long as the officer retiring has a good service record. But it needs to be authorized by the governing body of the municipality.