i have the same problem. sad thing? I know how to avoid it, and yet I still do it.
Here's something you might want to try.
I use a cream to remove hair, i like Nair for Men because it's got a little nicer smell and it's thin, but Magic works well too! Use as directed. the 'pimples' are really just bumps caused by the hair growing. they sometimes, due to reasons below grow back and can't quite break the skin naturally so they start to inflame and grow within the dermis.
to avoid them, try one or both of these suggestions. shave often. not giving the hair opportunity to grow back reduces hair bumps. also exfoliating good and hard daily. this will get rid of all those dead skin cells and dirt that pile up and block the hair growth. in effect you sorta scrape off the layer of 'shit' that's keeping the hair down and release it to grow above the skin.
hope this helps