Just because something's legal, doesn't mean it's a good idea. And conversely, just because something's illegal, doesn't mean it's automatically wrong.
Laws are made, repealed, and remade by people with biases, and while there are obvious ones most of us agree on (it should be illegal to murder, assault, and otherwise harm people) there are many that slip through the cracks without deeper inspection.
On the flip side, there are plenty of things that are technically legal that feel like they shouldn't be. Maybe they cross the line that bridges into the realm of creepy, or they would feel like an invasion of privacy if they happened to you, whatever the case, it can be bizarre to think about how many behaviors are not off-limits.
To this very point, people on a popular Reddit thread shared things that are perfectly legal but supremely creepy, and it borders on nightmare fuel.