Rashi defines kedusha as separation from arayot, thus connecting the opening of parshas Kedoshim with the close of Acharei Mos. Ramban disagrees and takes a broader view of kedusha, defining it as avoiding luxury and indulgence in favor of the pursuit of spirituality.
The Midrash asks a difficult to understand question on this command “kedoshim te’hiyu”: “yachol kamoni?” – is one obligated to be holy as much as G-d is holy? The Midrash answers that indeed, that is impossible, but we must be holy as much as people can be. How are we to make sense of this hava amina either according to Rashi or the Ramban? What does separation for arayot, or separation from indulgence, have to do with G-d?
R’ Shimon Shkop in his introduction to Sha’arei Yosher (text in Hebrew and in translation by R’ Micha Berger here) uses this Midrash as a basis to propose a different definition of kedusha. In a word, R’ Shimon equates kedusha with selflessness. Just as G-d acts as creator not for his own ends, but simply for the sake of the world, so too, we must dedicate ourselves to acting for the sake of others rather than our own needs.
But why then is mankind endowed with such strong feelings of self-love and ego? Rotzeh adam b’kav she’lo yoseir m’tisha kabin shel chaveiro! R’ Shimon answers that this trait of self love is also a necessary ingredient for achieving kedusha. A small person’s self-love will focus only on his/her selfish needs. However, a great person identifies with the community and the world. He/She attains self-fulfillment through the betterment of society as a whole. Society’s needs become their personal needs and agenda, motivating them to do great deeds on behalf of others.
It is this idea of kedusha as selflessness which the Midrash is addressing. As much as one strives for this G-dlike level of kedusha in selflessly serving the needs of others, by virtue of one’s humanity there will always still remain a tinge of selfishness, a lo lishma that is unavoidable.
Kedusha in R' Shimons' lexicon is not a synonym for withdrawal from the world. Quite the contrary. Kedusha demands that we engage in perfecting the world, and in doing so we achieve self-perfection as well.