Eggs develop an odor in cardboard boxes because the porous shells absorb odors from the surrounding environment, including the cardboard itself and anything else stored nearby.
Eggshells, while seemingly solid, are actually porous. This porosity allows for the exchange of gases, which is essential for the developing chick inside a fertilized egg. However, this also means that the eggshell can absorb odors from its surroundings. Cardboard, especially if it's recycled or has been stored in a less-than-ideal environment, can contain various volatile organic compounds (VOCs) that contribute to unpleasant smells. These VOCs are absorbed through the eggshell and can impart an off-flavor and odor to the egg itself. Furthermore, if the cardboard box is stored near other strong-smelling items (like onions, garlic, or cleaning supplies), the eggs will readily absorb those odors as well. The longer the eggs are stored in the cardboard, the more pronounced the odor will become.
Store eggs in their original carton in the coldest part of your refrigerator, away from strong-smelling foods, to minimize odor absorption and maintain freshness.