it is a necessity , when you have such huge demand for phones .. this was the same case when xiaomi was newly launched, bringing only 10,000 units per sale .. and now after increasing production and even with 3 lakh units per sale , situation is still the same , gone within a few minutes ...
as long as their is massive demand, and supply can't meet it, you can't do anything about it... and you will have great demand always when you are consistently bringing the most bang for buck hardware specs in growing smartphone market when you are so popular ..
same with one plus when it was new.. but one plus doesn't have huge volume numbers because they are in Premium > 30k category , so they were able to meet demand by increasing production..
Marketing reason is also their but you have to remember atleast early on , this was the only way Xiaomi could bring devices at such low prices and gain popularity/grow without spending big bucks on marketing like other companies ..