Spray foam over romex

Paul if double insulating conductors is not allowed common sense tells me closed cell foam surrounding non metallic conductors is even worse. Under what law of physics can a this be a acceptable situation or is running Romex through conduit cool now?