No need to feel guilty, as you did nothing wrong and were honest. This is Amazon's policy, not yours.
I've had similar events with Amazon and Walmart, where shipped oil leaked. I took pictures as proof that I'm not scamming anyone, and these companies either issued refunds or replaced the product. Yes, most of the oil was salvageable, but still; I had to clean up a mess of oil, transfer the remaining contents, etc. spent time contacting the company, etc. so I look at any "profit" as payment for my hassles.
As for the lectures on morality, get real. First, on a degree scale this does not even register. There are wars, human suffering, slavery, rape, outright theft, blasphemy, murders, assaults, environmental destruction, animal cruelty, and so forth. Secondly, it's not even a moral issue as this is their policy: e.g. when someone gives you something it's not wrong to take it, and here Amazon is giving it to him. Third, even if it was somehow considered "theft" (which it's not), it would be the equivalent of stealing 1/10000th of a penny from the average person. If someone took a pebble of sand from your yard, or breathed a few molecules of your air, or drank a drop of water from your swimming pool, would you find that morally unjustified? Probably not, and you would not even notice.
Bezos is among the richest humans on earth, to ever live. He has built a company that arguably harms Americans by destroying American jobs, and humans around the globe by causing sweat shops to thrive, and the environment thru the stress of moving shipping containers across the world to deliver products. Think of all the small American companies Amazon put out of business, all the dreams ruined, the small towns gutted, etc. by Bezos. Bezos probably earns more daily interest on his investments than you or I earn through labor in 1 or even 5-10 years of work. Think about that, and then the few dollars at issue here.