Adult male spiders typically have a pretty short lifeapan and in many short lifed spiders they will die within few weeks after maturing.
Very generally speaking:
In web building spiders many males will stop producing webs and thus catching prey (sometimes they will steal food from the females web, though). Instead they start roaming around (and be more frequently observed then their conspecific females) in search for mating partners. In some species of course the mating can be the quick end of the male in any case due to predation by the female. In others, where cannibalism is less likely, they will still exhaust themselfs quickly during the mating season and die soon.
Even in tarantulas, with adult lifespans of up to 20 years the males will often already die after 2-3 years.
The urge to mate is one of the biggest drivers in males and can largey outweigh the urge to eat (or even survive
). One can even observe this in mammals. I observed stray dogs in places where strays are treated well and many dogs look good.. the ones that are very thin are usual the (not neutered) males, busy with territory business and finding females.