He is pursuing it (the anti-Israel line) because he doesn't really have any choice internally. Otherwise he will be sidelined. It's very hard, even for people like Rafsanjani, to adopt a more moderate stance.
The pressure is growing inside the system to contain him and to pass these four years as quickly as possible without too much damage.
These comments are not being made by accident. This is something he has deliberated and thought out.
Probably, they anticipate that down the line there will be a point that confrontation will be inevitable. Therefore, they are just indicating that in case they come under any military pressure or any threat then they can properly defend themselves.