Perhaps the closest spelling match to cupboard is clapboard (which can refer either to a type of exterior wall used in building houses and other structures or to the rectangular device used to designate a scene and take in filming and to signal the beginning of the scene).
According to the phonetic system that Merriam-Webster's Eleventh Collegiate Dictionary uses, cupboard has the pronunciation given in this entry:
cupboard \ˈkə-bərd\ n (1530) : a closet with shelves where dishes, utensils, or food is kept; also, a small closet
In contrast, the pronunciation of clapboard is variable and, to some extent, depends on the sense of the word that one intends. Again from the Eleventh Collegiate:
clapboard \ˈkla-bərd;ˈkla(p)-ˌbȯrd\ n {part trans. of D klaphout stave wood} (ca. 1520) 1 archaic : a size of board for making staves and wainscoting 2 : a narrow board usu. thicker at one end edge than the other, used for siding 3 \ˈklap-ˌbȯrd\ : a pair of hinged boards one of which has a slate with data identifying a piece of film and which are banged together in front of a motion picture camera at the start of a take to facilitate editing — called also clapper board
So we have two nouns that came into the English language at approximately the same time, with the same pb combination at the junction of the two syllables and with the same -board ending. And yet, whereas the Eleventh Collegiate lists the only pronunciation of cupboard as \ˈkə-bərd\ , it lists three pronunciations for clapboard: \ˈkla-bərd\ , \ˈkla(p)-ˌbȯrd\ , and (for the much later meaning of the word) \ˈklap-ˌbȯrd\ .
A discussion headed "Clapboard & Cupboard" on a page of Merriam-Webster's site emphasizes the etymological differences between the two words, but makes no attempt to tie those differences to the variable pronunciations of clapboard versus the unitary pronunciation of cupboard:
Cupboard literally is a "cup board": that is, a board or table on which cups can be stored—at least at its origins in the Middle Ages. The "closet" meaning dates to the mid-1500s, and the "p" and "b" of the spelling have long since merged in pronunciation. As an exercise, try saying the literal "cup board" ten times fast, and you’ll experience firsthand how language evolves.
Clapboard has a different story: it came to English as a partial translation of the Dutch word klaphout, meaning "stave wood"; it probably derives from the Dutch verb clappen, meaning "to clap" or "to hit," from the way carpenters nailed the siding to houses. The literal pronunciation is sometimes used for the wood siding but always used when clapboard refers to the clapping slate used in filmmaking.
I suspect that the pronunciation of cupboard progressed through each of the three stages that clapboard exhibits, in this order: \ˈkəp-ˌbȯrd\ , \ˈkə(p)-ˌbȯrd\ , \ˈkə-bərd\ . But cupboard is a more common word than clapboard, and that may help explain why the slurring loss of the p sound occurred more completely and perhaps at an earlier date with cupboard than with clapboard. The completeness of the loss of the p sound may also owe something to the fact that almost every native English speaker first encounters cupboard in spoken English (such as in "Old Mother Hubbard") rather than in writing, reducing the possibility of a spelling-influenced pronunciation.
As for the mechanics of the transition from clearly sounded p to dropped p in the case of cupboard (and one pronunciation of clapboard), I defer to the answer posted by tchrist, who has far deeper understanding than I do of this aspect of language.