Motivation is primary because life is 'dynamic'; all is alive and conscious, ultimate (metaphysical) reality is of beings and their relationships.
This is The Spiritual - and materialism is wrong and evil because it denies this primacy.
Reality is thus dynamic - and also participative.
It is the fact of our participation in the creation of reality that makes motivation primary; because when we are participating in creating reality it is our motivation that shapes the nature of that reality.
(I mean this literally - it is not our subjective impression of reality that is shaped by motivation; but objective reality iself.)
A person of good motivation (aligned with God and divine creation) will make the world in harmony with good.
By contrast, a person of evil motivation (aligned with the personal powers of evil, and their intent to subvert, destroy, invert good, reducing creation to chaos) will pursue an anti-creative way of existence.
An evil-motivated person will - in his existence and overall in outcomes - be net-undoing creation, in effect working-against good.
Motivation describes which way we are pointing in our living...
We each are pointing either towards contributing to the harmonious development of on-going creation... or Not.
In all our doings, we are each aligned-with God's creative purposes, or Not.
It is not each individual action or type-of-action (as if these could truly detached from the stream of time...) that is crucial, rather it is the dynamic 'process' of creat-ing (in time; time is intrinsic to the dynamic).
To use different words; the actuality of participation is a weaving-in of our personal creating (through time) with God's creating (through time) - this harmonious weaving depends on aiming in the same direction, at the same goal.
Motivation therefore describes the direction of our intent.
Only when our direction is shared with God's, is our motivation the correct direction. Only then will our living be joined-with creation.
In sum: morality is dependent on our motivation; and motivation is our direction-of-pointing; and direction is our choice of 'alignment' in the spiritual warfare of mortal life.
Note added: It is interesting to consider why (and this goes back some decades) people-in-general absolutely refuse to consider the question of motivation - despite that without knowing (i.e. inferring, because it can never be 'known') motivation, most actions cannot be evaluated.
We know this from 'real life' - plus good fiction: it makes all the difference whether Gandalf says something, or if Saruman speaks the same words.
This refusal to discern and judge motivation is so pervasive, and goes so strongly against self-interest, that I regard it as pathological. In other words, it is part of a widespread/ all-but-universal 'mental illness'.
Which illness is the mainstream materialism/ secularism/ atheism... Once one has assumed that we life in a random-determined, purposeless and meaningless universe; then it seems peoples' motivations dwindle inexorably, and only the here-and-now behavioural-stimulus has any traction (and that not much).