Hammers and shovels are in the weapon's category.Apparently it's enough to set of the guards.When walking into NCR, be sure to not hold anything that can even be considered a weapon or drugs in your hands.
As the others said. Don't carry it in your hands, it's considered a weapon.IIRC correct you can attack with the shovel, that's why.
You can't "equip" your fists.