Should we first remove the unwanted independent variable or split the data into test train data?
Whether it's removed before/after splitting doesn't matter: the variable will not appear in any part of the data so it cannot cause any data leakage anyway.

However what might matter (at least in theory) is from investigating which part of the data was the decision made. Any preprocessing and design decision should be made based on the training set only in order to avoid any risk of data leakage (see example). In practice it's not really a problem in the case you mention.