In The Origins and Development of Classical Hinduism, A. L. Basham talks about the symbolism behind this practice.
Ch. 2. Early Speculations and the Later Sacrificial Cults
...
A feature of the aśvamedha which has aroused considerable comment is
the sexual character of one of the concluding ceremonies. The chief
queen lay down beside the body of the sacrificed horse and simulated
copulation with him, to the accompaniment of obscene remarks by the
priests and nobles standing by. This shows that the aśvamedha had
some of its roots in very ancient fertility ceremonies, and its
purpose was partly to ensure the productivity of the land,
represented by the queen.
Nevertheless the main emphasis of the
aśvamedha was on political power. The political system envisaged by
those who developed this sacrifice was what has elsewhere been called
quasi-feudal, wherein a powerful overlord received homage and tribute
from a circle of less powerful subordinates. If in the course of the
horse's wanderings any king had tried to block his passage and had
been defeated in the ensuing battle, there was no question of such a
king being dethroned or of the annexation of his lands by the
conqueror. The defeated king was merely expected to appear at the
final ceremony and to accept the overlordship of the victor. Thus the
tradition of the aśvamedha did not encourage the building of solid
centralized empires; rather, it visualized a loose federation of
kingdoms under a single overlord, all virtually independent in respect
of their internal affairs.
...
(p. 33-34)
Due to the offensive nature of certain verses in the Kṛṣṇa Yajurveda that describe the aśvamedha-yajña, Arthur Berriedale Keith, whose translation is available at sacred-texts.com has excluded them from his work.
vii. 4.19.
a O Amba! O Ambali! O Ambika!
b No one leadest me.
The wicked horse is sleeping.
c O fair one, clad in fair raiment in the world of heaven be ye two covered....
{...several verses omitted from original translation...}
1 When the deer eateth grain,
He deemeth not his flock fat.
When the Çadra woman is the loved of the Aryan,
She seeketh not wealth for prosperity....
{...several verses omitted from original translation...}
q Dadhikravan have I sung,
The swift strong horse.
May he make our mouths fragrant;
May he lengthen our days.
r Ye waters are healing;
Further us to strength,
To see great joy.
s The most auspicious flavour that is yours
Accord to us here
Like eager mothers.
t To him may we come with satisfaction,
To whose dwelling ye quicken us,
O waters, and propagate us.
For those contesting the authenticity of these verses or their translation, this is what Swami Vivekananda says:
And in the Vedic Ashvamedha sacrifice worse things would be done.... All the Brāhmanas mention them, and all the commentators admit them to be true. How can you deny them?
What I mean by mentioning all this is that there were many good things in the ancient times, but there were bad things too. The good things are to be retained, but the India that is to be, the future India, must be much greater than ancient India.
( Home/ Complete-Works/ Volume 6/ Epistles – Second Series/ LXXI Rakhal )