Tax breaks for property investors are turning losing investments into profits and pushing up prices, analysis finds.