In recent weeks, a pair of major tech companies have made serious missteps in pursuit of revenue—and reaped a whirlwind of reputational damage.