The mold is growing and producing that smell. Mold spores form on ALL bread when it is exposed to air. That's why it takes a few days for the mold to actually be visible. The mold doesn't just instantly grow, it "forms" over a few days and when enough of it accumulates, you see it.
Bread with preservatives, have a longer shelf life because they contain a mold inhibitor. After the expiration date on the bread, that "inhibitor" will no longer keep the mold from "blooming" and it will rapidly appear and multiply.
If the bread smells bad/moldy, DO NOT eat it! You can get sick on moldy bread.
My daughter(we) did a Science Fair Project on Mold Growth in Bread and this was some of the information we found.
Hope this answers your question.
An added note: Storing sealed bread in the Refrigerator does NOT extend the expiration date.