In the movie, American aircraft repeatedly strafe the decks of the ship and it's anti-aircraft stations, killing many of the exposed crewman and gunners. It seems like strafing would only be good for killing crewman on the deck as well as attracting attention, due to the heavily armored decks and superstructure that battleships and cruisers had.
Was this just done for the shock factor? Was there any real benefit to strafing?
The movie "Otoko Tachi no Yamato", which roughly translates to "The Men of Yamato", does indeed show strafing fighters.
You're entirely correct that mere .50cal bullets would be quite ineffective against the armored decks and superstructures of capital ships except in the most extreme of circumstances.
However, as seen in the film, not everybody was behind that armor. You still had anti-aircraft gunners more or less exposed to incoming fire... and there's a very good reason for fighters to kill AA crews. That is, it makes life much easier for the less maneuverable torpedo planes. The more gun crews you knock out, the fewer gun crews that will be flying at the "low and slow" torpedo bombers.
So, yes, a real benefit existed for strafing.