In a regular town and under regular conditions, I agree. However...
My system's honbu (headquarters dojo) is in Manhattan. They charge $25 for an intro lesson (rather, lessons). You have to make an appointment because it's a series of 3 private lessons with an instructor.
Furthermore, Manhattan is quite large with a lot of tourists. If you let everyone in the door to watch whenever they wanted to, it has the potential to turn into a tourist attraction. With very limited seating (most of the space is dojo floor space) and parents/spouses/people accompanying students the seating area is already shoulder to shoulder.
If you just show up and ask to watch a class, depending on the time of day and class size, you may get turned down due to space issues. If you call ahead and state why you're coming in, you'll most likely be allowed in or given a timeframe. If you just drop by and ask to watch and it happens to be children's testing night, I highly doubt they'd let you in. Pretty sure they'd be polite and ask that you come back another less hectic time.
And you can't watch through the windows, due to the architecture of the building. You'd have to stand on someone's shoulders, and you'd both have to be pretty tall.
Again, every place has their own unique circumstances. For someone to say this place has to be a McDojo because they charge for intro lessons and won't let people come in and observe isn't exactly fair. Time and place for everything.