Twitter has agreed to pay $150 million to settle allegations it misused private information, like telephone numbers, to target advertising at users after telling them the information would be used for security reasons, according to court documents filed on Wednesday.