In New Jersey em10, at any rate, the law requires that in an emergency, whether you have insurance or not, if you turn up at a hospital they MUST apply lifesaving treatment to the patient, also to any inborn child. They may then transfer you to a charity hospital or discharge you if that is appropriate. If you are discovered not to have a right of residence in the US, then once its safe to do so, you will be deported.
As I understand it (Sqad? Neti?) the thing in spain is that for residents, the spanish health service is spread over both private and state facilities. EHIC only entitles visitors to treatment at the state facilities, so if someone goes to a private facility and doesn't realise this, then they will end up with a bill which EHIC won't cover.