Haha that’s funny, you’re asking how a vampire can technically get a boner through the standards of the normal human living being, while in such a case, I’d wonder what the hell it’s doing being ’‘alive’’ to begin with.
It really depends on what specific mythology the vampire is based on. None the less, in fiction most vampires can at least mimic what the normal human can do. Some can eat food, even if they don’t need it. Others, like in Vampire the Masquerade, have special abilities like fleshcraft which lets you do stuff like turn your face into a giant vagina, so I’m sure they can make their penis go up if they wanna. Others may use willpower…one thing to consider is the human attribute often associated with vampires in fiction. There are two major things that I can see; power and lust/love. Which, usually, go together in this case, anyway.
With the first, a vampire is basically a super human; but prettier, stronger, with all sorts of powers and crap, and some limitations so it doesn’t become Superman. I believe that this is the ’‘evolution’’ of the fictional vampire through entertainment, from when it started as a monster to be feared, rather than a thing to want to be. Count Orlok VS Lestat, for example.
Lust and love portrays the sexy vampire, again Lestat, or Dracula’s hold over Mina. I guess Edward is in there too. More commonly, a vampire is a very charming being, which either uses sexual deception to survive, or defines its existence through remorse by remembering its existence as a happy human abruptly ended by tragedy and professed by sin, and finally being all translated into some sappy romantic tragedy. (Drac seeing his dead wife through Mina.)
Considering this, it’s a very prominent aspect in vampire tales, a good example I’d give for a vampire to ’‘sexually survive’’ is the story The Unicorn Tapestry, which involves a vampire basically charming his psychologist into fucking him.
See, vampire bodily functions, limitations and abilities are barely ever explained in anything, because the vampire is born of symbolism, and uses this to paint itself as a concept, at least through entertainement.
It would be very interesting to see a vampire story go further, and maybe there is one, but for the most part, you can’t really look at it this way. Can a vampire walk naked through the North Pole? Probably. Maybe not. But seeing as where the vampire is from, which I believe is the human mind and its ’‘what if’’ scenarios when it comes to strong emotions, (Despite the genre being relegated to bullshit in modern times.) stuff like a vampire’s chemistry is very secondary.
So whether its power, lust or love or all three put together, I can at least suggest that, since sex is often a great part of a vampire’s spectrum if you will, in order for it to keep on surviving, having a boner probbaly isn’t much of a problem for him.