To a deontological ethicist: yes, it does matter (and deontology is a major field of ethics). Intent is ethically salient. Attempted murder is unethical, even if it fails.
To a consequentialist (e.g. utilitarian): no, the reason or intent does not matter at all.
To a moral skeptic / moral anti-realist: the intent is irrelevant and the outcome is also objectively neutral. Both inputs and outputs are morally neutral.