Because trees and logistic regression follow different algorithms, it is entirely possible that they will give different results.
This usually implies that
x1
andx2
are correlated- Neither
x1
norx2
are good predictors ofy
.
If they are correlated, use PCA, or a similar technique, to reduce their correlation. Otherwise, which one to use depends on your data. You can use the training-testing set methodology to determine which gives a better fit and go with that model.
Just remember that trees are noisy. A random forest (randomForest package) may be a better model.