The default behaviour is cancel when the top corner (X) closing button is used.
This causes a refresh in client of the entity that is the page parameter for this page. Which I can understand that someone would like to have when changing values to that entity.
If you have a pop-up that does not change the entity then this refresh is unnecessary. I usually build a close button but it feels unnecessary to do that every time even when the button is not shown.
My suggestion is to have a choice of cancel or close. Cancel can still be default.
For transient objects, which have not been committed yet, the cancel will also result in a loss of the object, which is in many cases not desired. At least we should have the option to close instead of cancel without having to add a close button and selecting it as default closing action