Several factors that may be relevant...
Food aid may be distributed to households, but what happens with it next is partly up to the people in those households. As happens all over the world, people may need to sell needed food products because of greater needs, eg for life-saving medication, for shelter. There are people in the UK who have drastically cut down on food to afford to use their heating over the winter - similar calculations are made around the world all the time. It's also partly up to local law enforcement to ensure people aren't being robbed or otherwise pressured/coerced into giving up the aid they receive - as the local law enforcement is currently Hamas, their fellow terrorists and unaffiliated gangs, this won't be happening effectively and, in reality, these groups are among the ones most likely to exert pressure on people and take what they have.
In some situations, a proportion of aid, rather than being distributed to individuals and families, is used to keep local trading/markets/businesses functional. A devastated economy makes it harder to recover from disasters and conflicts. I'm not sure what if any percentage of current aid distribution in Gaza is being distributed in this way, but it may be a factor. Aid has been reaching bakeries so they could restart making bread, so people will be buying this.
There is a black market. This is a pretty common thing to have in any situation in which people are experiencing rationing or restrictions on items they need. During years of blockade, the black market in Gaza became very experienced in what it does - that is, getting things people want, for a profit. So, it's not 'just' people profiteering for the first time; it's an established economy in itself, run by people with decades of experience. Black markets tend to be unpredictable and volatile in their pricing, especially in disaster zones and times of war.
Supply and demand affect prices, and a fragile economy is vulnerable to dramatic, sometimes unpredictable, fluctuations in pricing. This applies to legitimate economies and black market economies.