Most cases the concerning pimples and pustules are both common and harmless. The size, shape and color of the spot may help determine whether there is something to be concerned about. From your description it seems like in grown hair that was infected.
Multiple tiny nodules beneath the skin of the penis and at the base of the penis are normal hair follicles. These nodules are all similar to each other in appearance. Having poor hygiene are both risk factors for this condition. Sometimes balanitis may result from condition. It requires medical treatment.
I would recommend the following-
1)Don't shave with a razor as they may cause micro trauma that is later infected. Try using a clipper or an electronic shaver, at least temporarily.
2)Always use protection while having sexual intercourse and follow safe sexual intercourse as these pustules may be infected with STD.
3)Take tab. Tylenol or tab. ibuprofen to reduce the inflammation and to reduce the pain.
4)Apply ointment povidone over the pustule. This may help in decreasing the spread of infection and improve the resolution of infection.
5)Follow a strict regimen of exercise .Also eat a balanced and healthy diet. This can help in maintaining a good perinea environment and prevent the chances of such pustules.