Not all forays into politics are equal. Two companies in the news in the past few days highlight this lesson.