Lockers are required on some attractions for several reasons. The main reason is safety. With a loose articles on board, it is possible for it to become loose and fall, hitting someone on the ground or somewhere on the ride. For the indoor rides where it "wouldn't matter", the bags could fall onto the ride track causing a vehicle to run over it, causing major damage to the vehicle and possibly turn that into a very dangerous accident.
Another reason is liability. If a guest makes it to the ride with a bag, and the team members let them leave it on the platform, that bag could be taken by another guest, or the guest themselves could be looking for a lawsuit and purposely claim that the team members took money from their bags in order to sue against Universal to get more money.
Some rides to enter and exit in different areas (Forbidden Journey, Dragons, Men in Black, Mummy) so that's another reason as well. They don't want people running up and down the platform getting their things back, it also slows dispatches.