One of the big complaints from gamers was the spotting system in the recent Battlefield games (most notably Bad Company 2), where enemies spotted would be marked, and the marker would stay on them even if the enemy retreated behind cover. This is why many referred to 3D spotting as wall hack.
Many have lobbied DICE to change the system, and it seems they’ve listened. According to DICE game designer Alan Kertz, the 3D spotting has been revamped in Battlefield 3. When you spot an enemy and he is in direct line of sight, a red marker will appear and will stay on the enemy as long as he is in your line of sight. If the enemy withdraws behind cover, the marker will disappear. However, the enemy will still be shown on the mini map for a set period of time.
Vehicles on the other hand, will always be marked, even if they retreat behind cover and you can’t directly see them. It will also be possible to spot enemies while in “freelook” inside jets, helicopters and other vehicles.
TL;DR 3D spotting is improved, the mark above the enemy only stays if he's in your line of sight. If he retreats to cover, the mark is removed.