Getting mail isn't something you are disciplined for at Basic. Sure, you may be instructed to do pushups or sing or some other light-hearted activity. It is not a punishment though. If you get to do pushups for a letter, consider it an opportunity to work on your pushups. If you are normally really bad at pushups and can only push out 10 of the 20 they ask you to do, you will not be screamed at and order to push another 10 out. DIs are not there to make getting corrispondance from home a loathsome activity you fear. Contact with family is very important for the morale of a troop.
As for the candy thing, does it really matter if the receiver has to share it with his platoon? Basic is about building teamwork and learning to operate as a cohesive entity. Pte(R) Bloggins gets a bag of Halloween candy so his morale is up. No one person needs a whole bag to themselves though. Sharing the goodies makes everyone happy (and is especially great for the troop who never receives anything from home). As well, recruits are being conditioned into eating well, exercizing regularily, and operating differently than they did as a civvie. Candy/cookies/junkfood is kinda counterproductive to the whole 'eating healthy' thing, so hence why they may be taken away until field time. In the field, they will be burning a lot more calories than normal, so a sugar-injection from a mini-Snickers bar could be the difference between a troop that can push out that one-more-hour of walking around lost on the nav course and crashing.
Similiarily, I celebrated my 21st birthday while on my 3s. My platoon instructors gave me a gift for it - being told to do 21 pushups in front of my platoon. In that course, we did pushups all day normally and some may say 'we have done enough pushups'. However, at that stage, 21 more pushups really means nothing. It was minorly embarassing doing them infront of my platoonmates as they heckled me about keeping my back straight, going lower, or whatnot. OMGburyMYheadINtheSAND, when I had to make my 'wizard' noises while doing it (since my nickname was Wizard due to playing D&D on the weekends). Frustrating that when I did the 21 requireed I then had to do another 1 for Queen, Canada, Lady P, CoR, the Army, my mom, my platoon, the other guy with a birthday that day, etc. All in all, it was in fun and is an example of how tight we were as a platoon.
Edit: Grammar and spelling