You need a newer SIM card - I think a 64k kind? - in order to use the iPhone. This is unrelated to data plan, etc. I have 2 lines on my plan, one iPhone and one regular old dummy phone (an
SE T226, if you must know) and I can swap the SIMs out between them without a problem because the T226's SIM is relatively new. That might have been the problem. BTW, you can get a new SIM from AT&T for like $5 and these will work just fine.
The only thing you'd want to be sure of is to turn off data somehow. I don't know that it's possible to turn it off when on cellular networks and on when on wifi though.