These are readily available at most hardware stores in the plumbing section. You would be surprised at how many homes I inspect with this type of drain, which I will always call-out and recommend replacement. The reason is the design. Water should flow, un-impeded through the pipes, carrying debris such as food particles, hair, dirt, toothpaste, etc. If the pipe is smooth on the inside, the debris will most likely get washed away. In the flexible pipe, this debris collects in the folds of the pipe, causing mold and mildew to grow, which is most likely that unpleasant smell you noticed. Not only does it collect in the folds, but it slows down the velocity of the water, like speed bumps, that is necessary to carry the debris through the trap and into the sewage system. This causes clogs lower down in the trap itself.
Why are they used? Well, I can tell you that most likely it was a sink or vanity was replaced or added, and the pipes did not quite line-up properly or they just did not want to cut PVC pipe. This is the easy fix and most likely done by the homeowner or an un-licensed handyman. A licensed plumbing contractor generally would not install these since the plumbing code prohibits its use.
If you happen to find this type of pipe, I recommend you have them replaced at some point very soon, before the room becomes “the stinky room”.