I am pretty sure this is a way for hotels to appear competitive on deal websites/apps. When I use like HotelTonight the “Resort Fee” is not included in their price. It’s definitely a dark pattern and I wish they were just up front about it and allow consumers to make informed decisions.
Using VPN to access European versions of booking sites will usually let you see listings with all fees included as required by law, although a shady hotel in New York can probably get away with adding a totally hidden fee for a while.