Was this legal?

Today I called in sick at work. It’s a small store (not naming the store) but it’s small enough where most of the time one person closes by themselves. Me and another girl were scheduled to close tonight but I woke up throwing up, decided to go back to sleep before work, still felt horrible. I texted them and let them know I couldn’t come in and that I tried to call but I don’t get service at my house. I live in an area where we only have satellite internet and unless you have an iPhone I’m not going to reach you through a call unless it’s over social media. Well, they told me I could come in late (originally scheduled to work at 2:30) and that if I was not in by 5:00 I am going to be written up and won’t be working for 5 days. Is that legal to get written up if I call in sick? I’ve never called out or have been written up before and they didn’t go over their policy’s with me well so I’m not sure what the policy says. I am still fairly new and have only been working there since May.