A person should accustom himself to always use the bathroom in the morning and evening, as this is an act of alacrity and cleanliness and brings one to holiness. [One should check if he needs the bathroom prior to prayer and meals in order for him to bless Hashem with purity of the body.]
 Kama 2/8; M”A 2/8; Ketzos Hashulchan 4/1
In previous times bathrooms were not readily available in all homes or areas and hence many times a person would have to search for a quiet spot to use the bathroom. Hence Admur first suggests in 2/8 that one should accustom himself to use the bathroom in the morning and evening, during times that not many people are around, as otherwise he will need to walk a far distance to avoid people seeing him. Admur then adds that furthermore, even in areas that one has a private bathroom, he is to accustom himself as above due to reasons of cleanliness and purity.
 Sefer Chassidim 818 brought in Kaf Hachaim 3/51; See also Admur 7/4