Facebook is pulling the plug on a controversial advertising program that served ads to people based on the activity of their friends, such as "Likes" and check-ins.