Sadly - just sticking a sprouting onion in the ground will not give you a crop of baby onions without a little more work. First it must grow and flower and go to seed ... you collect the seeds ... plant them in a greenhouse environment a month or two before planting season to get what are called "sets" ... then you plant the sets and they grow into onions. Onions work kind of like tomato plants - you will generally have better luck growing them from baby plants than from seed.
If an onion "rots" from the inside or the outside really depends on how they are stored. A properly stored onion is more likely to sprout - while an improperly stored one is more likely to mold and rot.
Onions and potatoes actually should not be stored in the refrigerator! They should be stored in a cool (50º-60º F), dry, well ventilated (take them out of the plastic bags!), dark location. The cabinet under the sink is NOT a good location ... nor is any other cabinet near water pipes, next to the dishwasher, next to the stove, etc. where there will be big temperature fluctuations. Once they hit the store shelves and you bring them home - you can figure on potatoes lasting 1-2 weeks, dry/storage onions 2-4 weeks.
I keep mine in wire baskets in my pantry and never buy more than I can use in about 2 weeks.