You don't need triple sec (quite a few of the recipes here don't contain it), but it is found in the classic recipe for margaritas. Both tequila and lime are tart, and the orange liqueur adds a touch of sweetness to balance out the flavor and cut through all of that tartness. You can substitute it for Cointreau if you already have a bottle of that orange liqueur on your bar.