As I read the question: a prospective employer is saying to a candidate: we are offering to pay for you to make a trip to visit us, but our willingness to pay is contingent on your accepting the job if we offer it. In other words, the possible outcomes are:
- no offer -- reimbursement
- offer rejected -- no reimbursement
- offer accepted -- reimbursement
The prospective employer has every right to present these terms, and the candidate has every right to reject them. In my experience, I've never heard of such a thing, for what that's worth.
If I were the candidate, I'd need a written commitment with a great deal of detail before I'd accept this proposition. The only case in which it makes sense to me is one in which a great deal of communication has already happened at a distance and the in-person interview is a sort of pro-forma ritual. Still, it's pretty unfair for the employer to retain the right to reject the employee and refuse that right, effectively, the other way around. So I'd characterize it as a jerk move.