How to hide a user profile based on custom field?
This way is absolutely okay. 
There is definitely the possibility to achieve the same result with the preprocess hook, but doing it in the template file is also a common "drupalish" way and has (as far as i know) no disadvantages. 

One thing:
Do you have already existing users? if so you should check if the variable exists before comparing it with a value... otherwise you could get a php-warning.