This question is far too broad for this forum. In fact, entire books have been written on this topic. An extensive review by Wohlrab, Stahl, & Kappeler (2006) "Motivations for getting tattooed and pierced" divides the literature into 10 broad categories of reasons:
- Beauty, art and fashion
- Personal narrative
- Physical endurance
- Group afﬁliations and commitment
- Spirituality and cultural tradition
- Sexual motivation
- No speciﬁc reason
To keep this answer's length sane, I'll just focus on the areas that you seem most concerned with.
There are probably a few different ways that tattoos and piercings can increase sexual attractiveness. For example, tattoos can be used to camouflage scars.
Human sexual preference is highly affected by environmental (ie, psychological, social, cultural, rather than genetic or evolutionary) factors. For example, sexual attraction can be susceptible to conditioning and imprinting, leading to an extensive list of fetishes and paraphilias, including stigmatophilia - "sexual arousal from body modifications such as piercings and tattoos".
Related to this, tattoos and piercings may provide exploitability signals - tattoos on women are associated with promiscuity for example, which is attractive to some:
Results suggest that sexual attraction to exploitability cues
functions to motivate men to employ exploitative strategies towards
accessible targets ...
And in much the same way as humans are prone to decorate spaces around them, so they decorate themselves as well - with fashion, accoutrements, and as it so happens, tattoos and piercings. Just as art and ornaments might decorate a room in your house, so they might decorate human bodies.
Fitness and fertility:
A common explanation for body modification from an evolutionary perspective is as a signal of fitness. This is called the handicap principle:
... reliable signals must be costly to the signaler, costing the
signaler something that could not be afforded by an individual with
less of a particular trait. ... Receivers know that the signal
indicates quality because inferior quality signalers cannot afford to
produce such wastefully extravagant signals.
Essentially, this is like saying "I am so fit / masculine / feminine that I can afford to mutilate my body without substantially affecting my attractiveness." For more details, see research by Carmen, Guitar, & Dillon (2012); Wohlrab et al (2008); and Koziel, Kretschmer, & Pawlowski (2010).