I’ve tried creating a new post on my WordPress blog and I’ve pasted an external code from a site, which has a <script src="..."></script> in order to work.
When I publish my post, the script tag simply gets deleted.
Is this a default behavior in WordPress? Is there any way to avoid this? (preferably without doing any modifications to WordPress or using inline code).
Did you switch the view after you add the code ? If so, don’t. WordPress will delete all tags if you switch to view back from HTML.