I assume you mean the online Apple Store. Yes, they will charge you state sales tax IF Apple has a "presence" in your state (assuming your state is Iowa.)
There are at least 5 Apple stores near Iowa City alone.
This is the same for any online purchase. Now if you have ordered your iMac from say "J&R Music World", it would have be a tax free purchase. However, then there may or may not have been a shipping charge.
That is very standard for any type of Internet purchase. If the company has a brick and mortar store presence in your state then they must charge sales tax if that state has a sales tax. If they don't then you are not charged sales tax. For example you were correctly charged sales tax because there are multiple Apple stores in Iowa, however if you purchased something from Amazon (no brick and mortar stores anywhere) you would not be charged sales tax.
Also, the day is coming when all internet sales will include sales tax. The States are making a lot of noise now about the hundreds of millions they're losing because of out-of-state purchases.
I think we have maybe 5 more years before the hammer falls.
Even if stores like Amazon don't charge the sales tax, you are required to report the purchase to the county and pay a "user fee" at the same % as the state tax in Iowa.
It may be that many residents don't follow the rule, but don't try to register a car in Iowa without paying the fee. It won't happen.