I've had that happen, but the ads only show up in that one app. They can't install ads across my whole iPhone like most adware does.
Ad Network Detector
Addons Detector
AirPush Detector
However, it's still preferrable to Apple's draconian policies.
If you want, you can install security tools which scan apps prior to being installed, like Lookout, which will alert you to various issues.
Yes there's a lot of spammy apps, but if you're even halfway aware of what you're doing, you'll have to be very unlucky to be caught out by one.