Hi Uma,
Maybe you can try the same thing with the latest DITA OT 3.6.1 to see if the same behavior persists.
I'm not sure if this is a bug in the publishing engine or not.
Looking at the DITA 1.3 specification for the "href" attribute:
Note that certain characters - including but not limited to the hash sign ("#"), question mark
("?"), back slash ("\"), and space - are not permitted unescaped within URIs.
Now I understand that you expect the spaces at the beginning and end of the href to be ignored but it seems the specification does not explicitly say this.
Regards,
Radu