Is this activity illegal? No. Should it be illegal? No.
Does that mean it's right? Also no.
Apple, like any other business in the US, reserves the right to refuse service to anyone. They should have exercised that right more often in the past. It's clear who the scalpers are. I'm sure that store managers and staff were able to identify them but simply weren't given the proper authority to send them to the back of the line.
The apparently proper handling of the supply chain this time around seems to have resolved the issue however. These scalpers did have to pay people to stand in line. Even if they're returning the items for a full refund, they are taking a loss.
As for those saying that scalping is "Just Capitalism", you are misinformed. An entity that is not a consumer of a product, or its producer, does not have an inherent right to disrupt the steady supply of said product between the actual producer and the intended consumer.
That said, if the producer of the product doesn't act to secure their intended distribution channel, one can hardly blame the scalper for acting in his or her own self interest.
Clearly, a properly supplied distribution chain is the most effective way to eliminate the disruption caused by scalpers, which Apple has now done. Hopefully though, they won't be afraid to put a stop to those behaviors if they happen for future product launches.