I think it is usually an act of homage, or a tribute. Schopenhauer wrote clearly as he was influenced through his knowledge of English, their clear writing style conditioned by their love of the empirical.
Plato wrote his philosophy in the form of plays as presumably theatre & the dramatic art was seen as the highest form of artistic achievement.
Ancient mathematicians wrote their puzzles in the form of verse as Poetry is usually seen to be the most important art-form in traditional societies. (And I'm not talking about the poetry that is written down. But that which can be performed).
Spinozas style is Euclidian. Woolhouse in Descarte, Leibniz & Spinoza: Substance in 17C Metaphysics has Leibniz saying he wasn't overly troubled by this
‘demonstration in the geometrical order’
and refers to it as
‘an empty pretentious device’
But most probably react as Bergson did, who said:
that complication of machinery, that power to crush which causes the beginner in the presence of the Ethics to be struck with admiration and terror as though he were before a battleship of the Dreadnaught Class
Is this but the schoolboys terror of the quadratic equation? The American beat poet Kenneth Rexroth in his essay Mathematical Elegance and Classic Fiction wrote:
People have written to ask what I meant by the five greatest works of prose fiction. They are there on the shelf, too, but first I would like to talk about the books that stand at the head of the row, and that, as a matter of fact, I have been reading now. They are Thomas Heath’s History of Greek Mathematics, his three-volume Commentary on Euclid, his Works of Archimedes, and Apollonius on Conic Sections...I discovered them when I was a boy of 19. Few books have influenced me more. I got them one by one from the library and read them in a kind of exaltation.
Like Homer and the tragedians, and in a sense, like the other books, too, they are great works of art.
In the first instance, however, the great mathematicians have always been artists...The mathematical term for beauty and perfection in the work is “elegance". In this term are embodied a group of moral qualities — the human mind’s confidence in its own order, nobility and discipline, and the realization that the order of the universe, beyond the narrow confines of the human mind, is also of the same kind.
Any fool can chatter about nobility and magnanimity and courage. It is another thing to embody these virtues.
Spinoza's Ethics by embodying Euclidean marble grace is also embodying the moral and artistic qualities Rexroth describes. Colebrook in her book on Gilles Deleuze says:
Style, for Deleuze [who is an admirer of Spinoza], is not something that ornaments voice or content. Voice, meaning, or what the text says is at one with its style.
And perhaps Bergson is saying of his admiring/terrified vision of a Dreadnaught on being confronted with Ethics what Rilke said in his First Elegy:
... For beauty is nothing but
the beginning of terror, that we are still able to bear,
and we revere it so, because it calmly disdains
to destroy us.