<p>I noticed when a file is executed on Windows (.exe or .dll), it is locked and cannot be deleted, moved or modified.</p>

<p>Linux, on the other hand, does not lock executing files and you <em>can</em> delete, move, or modify them.</p>

<p>Why does Windows lock when Linux does not? Is there an advantage to locking?</p>

I think linux / unix doesn't use the same locking mechanics because they are built from the ground up as a multi-user system - which would expect the possibility of multiple users using the same file, maybe even for different purposes.
Is there an advantage to locking?  Well, it could possibly reduce the amount of pointers that the OS would have to manage, but now a days the amount of savings is pretty negligible. The biggest advantage I can think of to locking is this: you save some user-viewable ambiguity. If user a is running a binary file, and user b deletes it, then the actual file has to stick around until user A's process completes.  Yet, if User B or any other users look on the file system for it, they won't be able to find it - but it will continue to take up space.  Not really a huge concern to me.
I think largely it's more of a question on backwards compatibility with window's file systems.