This isnt right because capital losses count against capital gains. So, taking a loss allows you to not pay taxes on an equal amount of gains that you would've been taxed on otherwise.
Same thing if I give you a million dollar, you buy expensive X thing but the seller goes bankrupt and never delivers anything.