Michelangelo was commissioned by the Florence cathedral to represent a hero of the bible.
Michelangelo portrayed him in the nude because it was typical in ancient greece to display the purity of the body. Although secular art was popular during the renaissance, this piece was highly religious, but shows proportion and dimension that first came to light in the renaissance during a revival of greek culture. The nudity portrays the beauty of the human body involved in biblical interactions, which is why it was still accepted by the church.
David is portrayed as a