Why does my husband have stabbing pain on the upper right side of his penis?

Could he have hernia. First thing is to make sure there is not a hernia or other anatomic problem referring pain towards the penis area. Second is whether pain occurs at rest or during erection. There are conditions of the penis that manifest with pain during erection. A urologist visit would be necessary for examination to determine there are no anatomic problems.
Pain. There could be a variety of reasons ranging from a blood clot to radiating pain from a pinched nerve to genital infections. He really should have this one looked at from his pcp.