The only thing I see stopping it is trust of the altcoin being able to manipulate the reserves of bitcoin. Surely it can't be impossible to code a contract that states that there can only be x alts for every btc, or vice versa? What have I missed?
A gold-backed banknote is actually issued on the basis of gold deposited with the bank - this requires both the depositor and the note-holder to trust the bank. If Bitcoin sees very widespread adoption, this just might happen, with brick-and-mortar banks issuing their own Bitcoin-backed digital tokens or even counterfeit-resistant paper notes that can be exchanged off-chain with Bitcoin-parity. The Bitcoins on deposit with the bank would form the backing and the issued tokens would hold parity as long as the bank did not issue fraudulent, unbacked notes.
A trustless (minimal trust) version of such notes is difficult to arrange. I saw one lecture that suggested using smart contracts to verify the altcoin's peg but such contracts would be prohibitively expensive. Lightning Network channel factories can be seen as a kind of "altcoin with Bitcoin peg" since a channel factory can exist indefinitely, in principle.
One approach I thought of would be to simply timelock some Bitcoin and issue altcoins pro rata. The hard part with this is how to "de-issue" the altcoins when the timelock expires. But you could solve this by creating a kind of distributed Bitcoin union. The way it works is that you lock up the distributed union's Bitcoin funds in a shared smart-contract that pays out to its funders pro-rata to their initial stake. This funding contract allows the issuance of altcoins pro rata by each member. Members can be dealt in and out by essentially dissolving and reforming the union (on the blockchain, obviously). For a funding member of the union to cash out (and thus acquire the other members' signatures), he/she must acquire and destroy the equivalent amount of altcoin (thus de-issuing it). As long as the total amount of altcoins issued can be publicly verified and as long as the funding UTXO is known in the blockchain, the altcoins are verifiably at parity with Bitcoin. There is no need to construct a "bulletproof" blockchain for this altcoin because the capitalization of the issued altcoin is much smaller - the altchain only needs to be strong enough to withstand attacks that are profitable at the scale of its capitalization. If an Bitcoin-backed altcoin is capitalized with $100M worth of Bitcoin and the cheapest attack on the altcoin would cost $500M, that's plenty of security for the altchain, even though it is not a sufficient level of security for the main blockchain. This means that a smaller altchain could clear transactions at point-of-sale speed or even faster. Such an altchain would require much less trust than is required for using an exchange, for example, and might be a superior alternative to channel factories or brick-and-mortar Bitcoin-backed notes, at least for some use cases.