"Tom said they were painted White to reflect the heat from the actuators/components in the wings. From a Lockheed documentation, I read it was a protective coating due to the manufacturing process of the "machined skin". I think they had wing actuator problems ? seals leaking? during
it's early flying days so Tom could be correct. If the case, I'm sure this was resolved shortly afterwards because camouflaged F104s began appearing during the early 1960's.
I do know the skin on the wing is actually machined...so I'd go with the coating answer.

Bob"

PS: Bob and Tom are the F104 pros from the "Starfighter" team.