Why does rinsing lentils create foam? Is this natural?
Yes, it's perfectly natural. Dust being rinsed off the outer surface of the lentils makes the water more viscous and helps to trap air in the form of small bubbles. In a strainer, the dust would be rinsed away, so you don't see the same effect; a spray nozzle especially adds a lot of turbulence, which causes more air to get trapped. You can get similar results when rinsing many processed, dried grains or pulses.

The effect from potatoes is similar, but it's caused by proteins in the potato being rinsed out into the soaking water. Neither has anything to do with the presence of arsenic, so don't worry.