As for why your nipples get hard, well, there are a few possible explanations. The first is that they're designed to get hard to assist with breastfeeding, which obviously makes a lot of sense. However, researchers are less clear as to why your nips tend to get stiff in sexual scenarios or when you're cold, but there are some suggestions that this has to do with the same reactions that cause your body's hair to stand up, among other possible explanations. It's also possible that your little "shirt tents" could also be a sign of arousal, according to the video.
For the full explanation, and even a segue into the topic of why men have nipples, check out the short but informative clip.