The 2 nuts are supposed to be used to lock each other (outside of the wheel rim), though it seems few people know this. Putting a nut on the inside of the rim actually puts more stress on the tube where it may press against the corners of the nut. Also, the nut prevents the tube from slipping slightly under (very) hard acceleration, but as a consequence, it is more prone to tear at the valve stem than if it did slip slightly within the stem hole diameter.
You can use just one nut on the outside of the wheel rim. under the valve cap. Technically, the nut is supposed to be screwed up against the valve cap instead of tight against the wheel rim, until/unless you need to fill it up with air - then screw the nut down so it is against the outside of the wheel rim - this prevents the valve stem from pushing down inside the rim and getting lost if your tube is very low in air pressure. With just the one nut (on the outside) you have enough valve stem to work with with various air filling nozzles. With (2) nuts onthe outside, it can be a challenge - I just use the (1) nut on the outside.