Battleships are meant to fight other battleships. And you don't nuke ships. They are a relic from WWI when ships still had to engage each other directly.
They also filled a shore bombardment role. But you also don't use nukes for that (rather modern aircraft).
And the Iowa battle ships were later equipped to handle "special weapons"
But in seriousness, the restraint shown in the use of nuclear weapons is amazing, one day the genie will be let out of the lamp but it hasn't yes.
On the topic of genies https://en.wikipedia.org/wiki/AIR-2_Genie (sigh) yes an air to air missile with a nuclear warhead was not only invented it was built and deployed... With how hard we were actively flirting with the demon that is nuclear war it is incredible that anyone is still alive.
They also filled a shore bombardment role. But you also don't use nukes for that (rather modern aircraft).
Disclaimer: IANAS (I Am Not A Squid)