The biggest strength for me is that I can ask them and they have to tell me. When I was job searching before I'd ask the recruiter and then they'd always ask me what my target is. Not showing your cards is like negotiation 101. Plus it's made fielding messages and emails easier. If they provide a range, I can just easily say "This position sounds interesting but unfortunately the salary range isn't what I'm looking for currently."
You're right that a lot of positions aren't great about this, I've literally seen "Pay starting at $0.01" or ranges literally $30k to +$200k. But I've seen it as a benefit in the negotiation process and it's just been easier to field recruiters.
> total comp
This law only covers salary as far as I know, so equity and such aren't included. Total comp is different.