It's legal, at least in the US, if there is a dotted or broken yellow line between the two lanes, the opposite lane is clear, and you have enough time/space to complete the overtaking before it swaps back to solid yellow. For obvious reasons, you generally want to spend as little time as possible in a lane that has traffic coming at you head-on.
Your opinion is asinine. If using the lane at that time/place to pass was not suitable it wouldn't be signed/marked for such. Increasing the time it takes for people to execute a pass is a regression in safety from the status quo.