Putting a tracker in the flash drive was John’s idea. That means Sherlock went to John before the meeting in the hideout, and involved John in every step he took. Sherlock and John decided what to do together.
Sherlock trusted and respected John enough to never leave him out again (learned his lesson after the Fall). Mary make unilateral decisions for the both of them, she doesn’t respect or believe in John enough.
John was right, talking things through is what couples do. Sherlock and John talked things through, John and Mary did not. I’ll leave you to your deductions